direct-io.hg

changeset 11298:d741e86a8766

[XEN] Add a start_pfn field in xen_domctl_getmemlist.
This is used by ia64 because it directly reads the P2M table.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author kaf24@firebug.cl.cam.ac.uk
date Wed Aug 30 18:19:04 2006 +0100 (2006-08-30)
parents 13e09ec65862
children 8a0ad47713f1
files tools/libxc/ia64/xc_ia64_stubs.c xen/arch/ia64/xen/dom0_ops.c xen/include/public/domctl.h
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_stubs.c	Wed Aug 30 18:08:19 2006 +0100
     1.2 +++ b/tools/libxc/ia64/xc_ia64_stubs.c	Wed Aug 30 18:19:04 2006 +0100
     1.3 @@ -36,7 +36,6 @@ xc_ia64_get_pfn_list(int xc_handle, uint
     1.4      struct xen_domctl domctl;
     1.5      int num_pfns,ret;
     1.6      unsigned int __start_page, __nr_pages;
     1.7 -    unsigned long max_pfns;
     1.8      xen_pfn_t *__pfn_buf;
     1.9  
    1.10      __start_page = start_page;
    1.11 @@ -44,27 +43,22 @@ xc_ia64_get_pfn_list(int xc_handle, uint
    1.12      __pfn_buf = pfn_buf;
    1.13    
    1.14      while (__nr_pages) {
    1.15 -        max_pfns = ((unsigned long)__start_page << 32) | __nr_pages;
    1.16          domctl.cmd = XEN_DOMCTL_getmemlist;
    1.17 -        domctl.domain   = (domid_t)domid;
    1.18 -        domctl.u.getmemlist.max_pfns = max_pfns;
    1.19 +        domctl.domain = (domid_t)domid;
    1.20 +        domctl.u.getmemlist.max_pfns = __nr_pages;
    1.21 +        domctl.u.getmemlist.start_pfn =__start_page;
    1.22          domctl.u.getmemlist.num_pfns = 0;
    1.23          set_xen_guest_handle(domctl.u.getmemlist.buffer, __pfn_buf);
    1.24  
    1.25 -        if ((max_pfns != -1UL)
    1.26 -            && mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) {
    1.27 +        if (mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) {
    1.28              PERROR("Could not lock pfn list buffer");
    1.29              return -1;
    1.30          }
    1.31  
    1.32          ret = do_domctl(xc_handle, &domctl);
    1.33  
    1.34 -        if (max_pfns != -1UL)
    1.35 -            (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t));
    1.36 +        (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t));
    1.37  
    1.38 -        if (max_pfns == -1UL)
    1.39 -            return 0;
    1.40 -        
    1.41          num_pfns = domctl.u.getmemlist.num_pfns;
    1.42          __start_page += num_pfns;
    1.43          __nr_pages -= num_pfns;
     2.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Wed Aug 30 18:08:19 2006 +0100
     2.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Wed Aug 30 18:19:04 2006 +0100
     2.3 @@ -39,8 +39,8 @@ long arch_do_domctl(xen_domctl_t *op, XE
     2.4      {
     2.5          unsigned long i;
     2.6          struct domain *d = find_domain_by_id(op->domain);
     2.7 -        unsigned long start_page = op->u.getmemlist.max_pfns >> 32;
     2.8 -        unsigned long nr_pages = op->u.getmemlist.max_pfns & 0xffffffff;
     2.9 +        unsigned long start_page = op->u.getmemlist.start_pfn;
    2.10 +        unsigned long nr_pages = op->u.getmemlist.max_pfns;
    2.11          unsigned long mfn;
    2.12  
    2.13          if ( d == NULL ) {
     3.1 --- a/xen/include/public/domctl.h	Wed Aug 30 18:08:19 2006 +0100
     3.2 +++ b/xen/include/public/domctl.h	Wed Aug 30 18:19:04 2006 +0100
     3.3 @@ -16,7 +16,7 @@
     3.4  
     3.5  #include "xen.h"
     3.6  
     3.7 -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000001
     3.8 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000002
     3.9  
    3.10  #define uint64_t uint64_aligned_t
    3.11  
    3.12 @@ -72,7 +72,10 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_getdo
    3.13  #define XEN_DOMCTL_getmemlist         6
    3.14  struct xen_domctl_getmemlist {
    3.15      /* IN variables. */
    3.16 +    /* Max entries to write to output buffer. */
    3.17      uint64_t max_pfns;
    3.18 +    /* Start index in guest's page list. */
    3.19 +    uint64_t start_pfn;
    3.20      XEN_GUEST_HANDLE_64(xen_pfn_t) buffer;
    3.21      /* OUT variables. */
    3.22      uint64_t num_pfns;