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

[Xen-devel] [PATCH 1 of 2] xen/x86: make __direct_remap_pfn_range()'s return value meaningful



 arch/x86/mm/ioremap-xen.c |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)


This change fixes the xc_map_foreign_bulk interface, which would
otherwise cause SIGBUS when pages are gone because -ENOENT is not
returned as expected by the IOCTL_PRIVCMD_MMAPBATCH_V2 ioctl.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

diff -r 164cbc688ec7 -r df9e25a0189b arch/x86/mm/ioremap-xen.c
--- a/arch/x86/mm/ioremap-xen.c
+++ b/arch/x86/mm/ioremap-xen.c
@@ -48,7 +48,7 @@ static int __direct_remap_pfn_range(stru
                                    pgprot_t prot,
                                    domid_t  domid)
 {
-       int rc;
+       int rc = 0;
        unsigned long i, start_address;
        mmu_update_t *u, *v, *w;
 
@@ -68,8 +68,8 @@ static int __direct_remap_pfn_range(stru
                                                 direct_remap_area_pte_fn, &w);
                        if (rc)
                                goto out;
-                       rc = -EFAULT;
-                       if (HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0)
+                       rc = HYPERVISOR_mmu_update(u, v - u, NULL, domid);
+                       if (rc  < 0)
                                goto out;
                        v = w = u;
                        start_address = address;
@@ -94,13 +94,9 @@ static int __direct_remap_pfn_range(stru
                                         direct_remap_area_pte_fn, &w);
                if (rc)
                        goto out;
-               rc = -EFAULT;
-               if (unlikely(HYPERVISOR_mmu_update(u, v - u, NULL, domid) < 0))
-                       goto out;
+               rc = HYPERVISOR_mmu_update(u, v - u, NULL, domid);
        }
 
-       rc = 0;
-
  out:
        flush_tlb_all();
 

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


 


Rackspace

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