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

[Xen-changelog] [xen-unstable] 32-on-64: Fix physaddr_bitsize computation when creating a 32b x86



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1212659228 -3600
# Node ID 31a941632a5db6ea91325a13d875e714918ac428
# Parent  129a511d31ee2c619d5ec902a4f93f383dca245d
32-on-64: Fix physaddr_bitsize computation when creating a 32b x86
compat domain.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/domain.c       |    6 ++++--
 xen/arch/x86/domain_build.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff -r 129a511d31ee -r 31a941632a5d xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Thu Jun 05 10:42:37 2008 +0100
+++ b/xen/arch/x86/domain.c     Thu Jun 05 10:47:08 2008 +0100
@@ -350,8 +350,10 @@ int switch_compat(struct domain *d)
     }
 
     d->arch.physaddr_bitsize =
-        fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 1
-        + (PAGE_SIZE - 2);
+        /* 2^n entries can be contained in guest's p2m mapping space */
+        fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 3
+        /* 2^n pages -> 2^(n+PAGE_SHIFT) bits */
+        + PAGE_SHIFT;
 
     return 0;
 
diff -r 129a511d31ee -r 31a941632a5d xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Thu Jun 05 10:42:37 2008 +0100
+++ b/xen/arch/x86/domain_build.c       Thu Jun 05 10:47:08 2008 +0100
@@ -356,8 +356,10 @@ int __init construct_dom0(
 #if defined(__x86_64__)
     if ( is_pv_32on64_domain(d) )
         d->arch.physaddr_bitsize =
-            fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 1
-            + (PAGE_SIZE - 2);
+            /* 2^n entries can be contained in guest's p2m mapping space */
+            fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 3
+            /* 2^n pages -> 2^(n+PAGE_SHIFT) bits */
+            + PAGE_SHIFT;
 #endif
 
     /*

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


 


Rackspace

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