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] 32-on-64: Fix physaddr_bitsize computatio

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] 32-on-64: Fix physaddr_bitsize computation when creating a 32b x86
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 05 Jun 2008 11:50:15 -0700
Delivery-date: Thu, 05 Jun 2008 11:50:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] 32-on-64: Fix physaddr_bitsize computation when creating a 32b x86, Xen patchbot-unstable <=