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] [xen-unstable] x86-64: fix hotplug fault handling for 32

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86-64: fix hotplug fault handling for 32-bit domains' M2P range
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Mar 2010 09:45:19 -0800
Delivery-date: Wed, 03 Mar 2010 09:45:58 -0800
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 1267638118 0
# Node ID b8d2a4134a6823f6d5179928a0618eaf33be4684
# Parent  401c0012b8273dbe6711c48d9d5bd2409808330f
x86-64: fix hotplug fault handling for 32-bit domains' M2P range

- handle only when memory hotplug regions were actually found
- fix off-by-one error in fault handler's sanity checking
- use first L4 table entry

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/x86_64/mm.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff -r 401c0012b827 -r b8d2a4134a68 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  Wed Mar 03 17:40:48 2010 +0000
+++ b/xen/arch/x86/x86_64/mm.c  Wed Mar 03 17:41:58 2010 +0000
@@ -1213,12 +1213,9 @@ int pagefault_by_memadd(unsigned long ad
 {
     struct domain *d = current->domain;
 
-    if (guest_mode(regs) &&
-        is_pv_32bit_domain(d) &&
-        ((addr >= HYPERVISOR_COMPAT_VIRT_START(d)) &&
-             (addr < MACH2PHYS_COMPAT_VIRT_END)) )
-            return 1;
-    return 0;
+    return mem_hotplug && guest_mode(regs) && is_pv_32bit_domain(d) &&
+           (addr >= HYPERVISOR_COMPAT_VIRT_START(d)) &&
+           (addr < MACH2PHYS_COMPAT_VIRT_END);
 }
 
 int handle_memadd_fault(unsigned long addr, struct cpu_user_regs *regs)
@@ -1236,15 +1233,15 @@ int handle_memadd_fault(unsigned long ad
     if (!is_pv_32on64_domain(d))
         return 0;
 
-    if ((addr < HYPERVISOR_COMPAT_VIRT_START(d)) ||
-             (addr > MACH2PHYS_COMPAT_VIRT_END) )
+    if ( (addr < HYPERVISOR_COMPAT_VIRT_START(d)) ||
+         (addr >= MACH2PHYS_COMPAT_VIRT_END) )
         return 0;
 
     mfn = (read_cr3()) >> PAGE_SHIFT;
 
     pl4e = map_domain_page(mfn);
 
-    l4e = pl4e[addr];
+    l4e = pl4e[0];
 
     if (!(l4e_get_flags(l4e) & _PAGE_PRESENT))
         goto unmap;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86-64: fix hotplug fault handling for 32-bit domains' M2P range, Xen patchbot-unstable <=