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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1212659454 -3600
# Node ID 6c60d618b889353e875199d8128185014082b389
# Parent  ca3ebd5b04d327b623b6c8ac1d1e9ed31093f974
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-unstable changeset:   17783:31a941632a5db6ea91325a13d875e714918ac428
xen-unstable date:        Thu Jun 05 10:47:08 2008 +0100
---
 xen/arch/x86/domain.c       |    6 ++++--
 xen/arch/x86/domain_build.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff -r ca3ebd5b04d3 -r 6c60d618b889 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Mon Jun 02 10:59:29 2008 +0100
+++ b/xen/arch/x86/domain.c     Thu Jun 05 10:50:54 2008 +0100
@@ -347,8 +347,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 ca3ebd5b04d3 -r 6c60d618b889 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Mon Jun 02 10:59:29 2008 +0100
+++ b/xen/arch/x86/domain_build.c       Thu Jun 05 10:50:54 2008 +0100
@@ -365,8 +365,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®.