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

[Xen-devel] [PATCH] linux/x86: make __direct_remap_pfn_range()'s return value meaningful



From: Olaf Hering <ohering@xxxxxxxxxx>

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>

--- a/arch/i386/mm/ioremap-xen.c
+++ b/arch/i386/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();
 



Attachment: xen-x86-privcmd-enoent.patch
Description: Text document

_______________________________________________
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®.