[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Remove obsolete bug work around code in xc_ia64_stubs.c.



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1178565877 21600
# Node ID d1ce60b8070f640408c702f1fbbef0f6ffda8586
# Parent  4b4db1f10147ec58468c06b56e8ecf6319bd516a
[IA64] Remove obsolete bug work around code in xc_ia64_stubs.c.

Now xencomm solved the issue.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/ia64/xc_ia64_stubs.c |   56 ++++++++++-----------------------------
 1 files changed, 15 insertions(+), 41 deletions(-)

diff -r 4b4db1f10147 -r d1ce60b8070f tools/libxc/ia64/xc_ia64_stubs.c
--- a/tools/libxc/ia64/xc_ia64_stubs.c  Mon May 07 13:14:27 2007 -0600
+++ b/tools/libxc/ia64/xc_ia64_stubs.c  Mon May 07 13:24:37 2007 -0600
@@ -23,54 +23,28 @@ xc_ia64_fpsr_default(void)
     return FPSR_DEFAULT;
 }
 
-/*  
-    VMM uses put_user to copy pfn_list to guest buffer, this maybe fail,
-    VMM doesn't handle this now.
-    This method will touch guest buffer to make sure the buffer's mapping
-    is tracked by VMM,
- */
 int
 xc_ia64_get_pfn_list(int xc_handle, uint32_t domid, xen_pfn_t *pfn_buf,
                      unsigned int start_page, unsigned int nr_pages)
 {
-    struct xen_domctl domctl;
-    int num_pfns,ret;
-    unsigned int __start_page, __nr_pages;
-    xen_pfn_t *__pfn_buf;
+    DECLARE_DOMCTL;
+    int ret;
 
-    __start_page = start_page;
-    __nr_pages = nr_pages;
-    __pfn_buf = pfn_buf;
-  
-    while (__nr_pages) {
-        domctl.cmd = XEN_DOMCTL_getmemlist;
-        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);
+    domctl.cmd = XEN_DOMCTL_getmemlist;
+    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 (mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) {
-            PERROR("Could not lock pfn list buffer");
-            return -1;
-        }
+    if (lock_pages(pfn_buf, nr_pages * sizeof(xen_pfn_t)) != 0) {
+        PERROR("Could not lock pfn list buffer");
+        return -1;
+    }
+    ret = do_domctl(xc_handle, &domctl);
+    unlock_pages(pfn_buf, nr_pages * sizeof(xen_pfn_t));
 
-        ret = do_domctl(xc_handle, &domctl);
-
-        (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t));
-
-        num_pfns = domctl.u.getmemlist.num_pfns;
-        __start_page += num_pfns;
-        __nr_pages -= num_pfns;
-        __pfn_buf += num_pfns;
-
-        if (ret < 0)
-            // dummy write to make sure this tlb mapping is tracked by VMM
-            *__pfn_buf = 0;
-        else
-            return nr_pages;
-    }
-    return nr_pages;
+    return ret < 0 ? -1 : nr_pages;
 }
 
 int

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.