# HG changeset patch # User yamahata@xxxxxxxxxxxxx # Date 1178516879 -32400 # Node ID a6516a8072b9039b90c32965a9faf546ec8d68bf # Parent d2ecb46c6fdd7f1e6cf89c3294eff06c45616229 remove obsolete bug work around code in xc_ia64_stubs.c. Now xencomm solved the issue. PATCHNAME: remove_bug_work_around_in_xc_ia64_stubs_c Signed-off-by: Isaku Yamahata diff -r d2ecb46c6fdd -r a6516a8072b9 tools/libxc/ia64/xc_ia64_stubs.c --- a/tools/libxc/ia64/xc_ia64_stubs.c Mon May 07 12:17:34 2007 +0900 +++ b/tools/libxc/ia64/xc_ia64_stubs.c Mon May 07 14:47:59 2007 +0900 @@ -23,53 +23,29 @@ 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; - } + if (ret < 0) + return -1; return nr_pages; }