# HG changeset patch # User gingold@virtu10 # Node ID 567c096d007013f3195037fcb69d8c79548c57dd # Parent 684fdcfb251a443fa885c142b427d253ec033212 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 diff -r 684fdcfb251a -r 567c096d0070 tools/libxc/ia64/xc_ia64_stubs.c --- a/tools/libxc/ia64/xc_ia64_stubs.c Mon Aug 28 16:26:37 2006 -0600 +++ b/tools/libxc/ia64/xc_ia64_stubs.c Tue Aug 29 09:50:57 2006 +0200 @@ -36,7 +36,6 @@ xc_ia64_get_pfn_list(int xc_handle, uint struct xen_domctl domctl; int num_pfns,ret; unsigned int __start_page, __nr_pages; - unsigned long max_pfns; xen_pfn_t *__pfn_buf; __start_page = start_page; @@ -44,27 +43,22 @@ xc_ia64_get_pfn_list(int xc_handle, uint __pfn_buf = pfn_buf; while (__nr_pages) { - max_pfns = ((unsigned long)__start_page << 32) | __nr_pages; domctl.cmd = XEN_DOMCTL_getmemlist; - domctl.domain = (domid_t)domid; - domctl.u.getmemlist.max_pfns = max_pfns; + domctl.domain = (domid_t)domid; + domctl.u.getmemlist.max_pfns = __nr_pages; + domctl.u.getmemlist.start_pfn =__start_page; domctl.u.getmemlist.num_pfns = 0; set_xen_guest_handle(domctl.u.getmemlist.buffer, __pfn_buf); - if ((max_pfns != -1UL) - && mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) { + if (mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) { PERROR("Could not lock pfn list buffer"); return -1; } ret = do_domctl(xc_handle, &domctl); - if (max_pfns != -1UL) - (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)); + (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)); - if (max_pfns == -1UL) - return 0; - num_pfns = domctl.u.getmemlist.num_pfns; __start_page += num_pfns; __nr_pages -= num_pfns; diff -r 684fdcfb251a -r 567c096d0070 xen/arch/ia64/xen/dom0_ops.c --- a/xen/arch/ia64/xen/dom0_ops.c Mon Aug 28 16:26:37 2006 -0600 +++ b/xen/arch/ia64/xen/dom0_ops.c Tue Aug 29 09:50:57 2006 +0200 @@ -40,8 +40,8 @@ long arch_do_domctl(xen_domctl_t *op, XE { unsigned long i; struct domain *d = find_domain_by_id(op->domain); - unsigned long start_page = op->u.getmemlist.max_pfns >> 32; - unsigned long nr_pages = op->u.getmemlist.max_pfns & 0xffffffff; + unsigned long start_page = op->u.getmemlist.start_pfn; + unsigned long nr_pages = op->u.getmemlist.max_pfns; unsigned long mfn; if ( d == NULL ) { diff -r 684fdcfb251a -r 567c096d0070 xen/include/public/domctl.h --- a/xen/include/public/domctl.h Mon Aug 28 16:26:37 2006 -0600 +++ b/xen/include/public/domctl.h Tue Aug 29 09:50:57 2006 +0200 @@ -73,6 +73,7 @@ struct xen_domctl_getmemlist { struct xen_domctl_getmemlist { /* IN variables. */ uint64_t max_pfns; + uint64_t start_pfn; XEN_GUEST_HANDLE_64(ulong) buffer; /* OUT variables. */ uint64_t num_pfns;