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-changelog

[Xen-changelog] [linux-2.6.18-xen] xen/x86: make __direct_remap_pfn_rang

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] xen/x86: make __direct_remap_pfn_range()'s return value meaningful
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Sep 2010 08:40:05 -0700
Delivery-date: Wed, 15 Sep 2010 08:40:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1284395993 -3600
# Node ID 0051d294bb60fc096849df586d56a389e32650d4
# Parent  e8f97b92d307c6786992bb118dddc6f3466bfd01
xen/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>
---
 arch/i386/mm/ioremap-xen.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff -r e8f97b92d307 -r 0051d294bb60 arch/i386/mm/ioremap-xen.c
--- a/arch/i386/mm/ioremap-xen.c        Mon Sep 13 17:38:36 2010 +0100
+++ b/arch/i386/mm/ioremap-xen.c        Mon Sep 13 17:39:53 2010 +0100
@@ -45,7 +45,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;
 
@@ -65,8 +65,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;
@@ -90,12 +90,8 @@ 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 = 0;
+               rc = HYPERVISOR_mmu_update(u, v - u, NULL, domid);
+       }
 
  out:
        flush_tlb_all();

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] xen/x86: make __direct_remap_pfn_range()'s return value meaningful, Xen patchbot-linux-2.6.18-xen <=