direct-io.hg

changeset 15105:d1ce60b8070f

[IA64] Remove obsolete bug work around code in xc_ia64_stubs.c.

Now xencomm solved the issue.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Mon May 07 13:24:37 2007 -0600 (2007-05-07)
parents 4b4db1f10147
children d7303c4a9dab
files tools/libxc/ia64/xc_ia64_stubs.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_stubs.c	Mon May 07 13:14:27 2007 -0600
     1.2 +++ b/tools/libxc/ia64/xc_ia64_stubs.c	Mon May 07 13:24:37 2007 -0600
     1.3 @@ -23,54 +23,28 @@ xc_ia64_fpsr_default(void)
     1.4      return FPSR_DEFAULT;
     1.5  }
     1.6  
     1.7 -/*  
     1.8 -    VMM uses put_user to copy pfn_list to guest buffer, this maybe fail,
     1.9 -    VMM doesn't handle this now.
    1.10 -    This method will touch guest buffer to make sure the buffer's mapping
    1.11 -    is tracked by VMM,
    1.12 - */
    1.13  int
    1.14  xc_ia64_get_pfn_list(int xc_handle, uint32_t domid, xen_pfn_t *pfn_buf,
    1.15                       unsigned int start_page, unsigned int nr_pages)
    1.16  {
    1.17 -    struct xen_domctl domctl;
    1.18 -    int num_pfns,ret;
    1.19 -    unsigned int __start_page, __nr_pages;
    1.20 -    xen_pfn_t *__pfn_buf;
    1.21 -
    1.22 -    __start_page = start_page;
    1.23 -    __nr_pages = nr_pages;
    1.24 -    __pfn_buf = pfn_buf;
    1.25 -  
    1.26 -    while (__nr_pages) {
    1.27 -        domctl.cmd = XEN_DOMCTL_getmemlist;
    1.28 -        domctl.domain = (domid_t)domid;
    1.29 -        domctl.u.getmemlist.max_pfns = __nr_pages;
    1.30 -        domctl.u.getmemlist.start_pfn =__start_page;
    1.31 -        domctl.u.getmemlist.num_pfns = 0;
    1.32 -        set_xen_guest_handle(domctl.u.getmemlist.buffer, __pfn_buf);
    1.33 +    DECLARE_DOMCTL;
    1.34 +    int ret;
    1.35  
    1.36 -        if (mlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t)) != 0) {
    1.37 -            PERROR("Could not lock pfn list buffer");
    1.38 -            return -1;
    1.39 -        }
    1.40 -
    1.41 -        ret = do_domctl(xc_handle, &domctl);
    1.42 -
    1.43 -        (void)munlock(__pfn_buf, __nr_pages * sizeof(xen_pfn_t));
    1.44 +    domctl.cmd = XEN_DOMCTL_getmemlist;
    1.45 +    domctl.domain = (domid_t)domid;
    1.46 +    domctl.u.getmemlist.max_pfns = nr_pages;
    1.47 +    domctl.u.getmemlist.start_pfn = start_page;
    1.48 +    domctl.u.getmemlist.num_pfns = 0;
    1.49 +    set_xen_guest_handle(domctl.u.getmemlist.buffer, pfn_buf);
    1.50  
    1.51 -        num_pfns = domctl.u.getmemlist.num_pfns;
    1.52 -        __start_page += num_pfns;
    1.53 -        __nr_pages -= num_pfns;
    1.54 -        __pfn_buf += num_pfns;
    1.55 +    if (lock_pages(pfn_buf, nr_pages * sizeof(xen_pfn_t)) != 0) {
    1.56 +        PERROR("Could not lock pfn list buffer");
    1.57 +        return -1;
    1.58 +    }
    1.59 +    ret = do_domctl(xc_handle, &domctl);
    1.60 +    unlock_pages(pfn_buf, nr_pages * sizeof(xen_pfn_t));
    1.61  
    1.62 -        if (ret < 0)
    1.63 -            // dummy write to make sure this tlb mapping is tracked by VMM
    1.64 -            *__pfn_buf = 0;
    1.65 -        else
    1.66 -            return nr_pages;
    1.67 -    }
    1.68 -    return nr_pages;
    1.69 +    return ret < 0 ? -1 : nr_pages;
    1.70  }
    1.71  
    1.72  int