ia64/xen-unstable

changeset 17789:31a941632a5d

32-on-64: Fix physaddr_bitsize computation when creating a 32b x86
compat domain.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 05 10:47:08 2008 +0100 (2008-06-05)
parents 129a511d31ee
children 49a0d28a16e0
files xen/arch/x86/domain.c xen/arch/x86/domain_build.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Thu Jun 05 10:42:37 2008 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Thu Jun 05 10:47:08 2008 +0100
     1.3 @@ -350,8 +350,10 @@ int switch_compat(struct domain *d)
     1.4      }
     1.5  
     1.6      d->arch.physaddr_bitsize =
     1.7 -        fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 1
     1.8 -        + (PAGE_SIZE - 2);
     1.9 +        /* 2^n entries can be contained in guest's p2m mapping space */
    1.10 +        fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 3
    1.11 +        /* 2^n pages -> 2^(n+PAGE_SHIFT) bits */
    1.12 +        + PAGE_SHIFT;
    1.13  
    1.14      return 0;
    1.15  
     2.1 --- a/xen/arch/x86/domain_build.c	Thu Jun 05 10:42:37 2008 +0100
     2.2 +++ b/xen/arch/x86/domain_build.c	Thu Jun 05 10:47:08 2008 +0100
     2.3 @@ -356,8 +356,10 @@ int __init construct_dom0(
     2.4  #if defined(__x86_64__)
     2.5      if ( is_pv_32on64_domain(d) )
     2.6          d->arch.physaddr_bitsize =
     2.7 -            fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 1
     2.8 -            + (PAGE_SIZE - 2);
     2.9 +            /* 2^n entries can be contained in guest's p2m mapping space */
    2.10 +            fls((1UL << 32) - HYPERVISOR_COMPAT_VIRT_START(d)) - 3
    2.11 +            /* 2^n pages -> 2^(n+PAGE_SHIFT) bits */
    2.12 +            + PAGE_SHIFT;
    2.13  #endif
    2.14  
    2.15      /*