WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: make __direct_remap_pfn_range()'s return value meaningful
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 10 Sep 2010 16:42:41 +0100
Cc: Grzegorz.Milos@xxxxxxxxxx, Olaf Hering <OHering@xxxxxxxxxx>
Delivery-date: Fri, 10 Sep 2010 08:44:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: make __direct_remap_pfn_range()'s return value meaningful, Jan Beulich <=