ia64/xen-unstable

changeset 19108:839bece33989

x86: VCPU structure must reside below 4GB, since it contains embedded
PAE mode PDPTEs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jan 28 17:05:18 2009 +0000 (2009-01-28)
parents 696351cde9a4
children 0858f961c77a
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Wed Jan 28 16:58:41 2009 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Wed Jan 28 17:05:18 2009 +0000
     1.3 @@ -165,14 +165,21 @@ void dump_pageframe_info(struct domain *
     1.4  struct vcpu *alloc_vcpu_struct(void)
     1.5  {
     1.6      struct vcpu *v;
     1.7 -    if ( (v = xmalloc(struct vcpu)) != NULL )
     1.8 +    /*
     1.9 +     * This structure contains embedded PAE PDPTEs, used when an HVM guest
    1.10 +     * runs on shadow pagetables outside of 64-bit mode. In this case the CPU
    1.11 +     * may require that the shadow CR3 points below 4GB, and hence the whole
    1.12 +     * structure must satisfy this restriction. Thus we specify MEMF_bits(32).
    1.13 +     */
    1.14 +    v = alloc_xenheap_pages(get_order_from_bytes(sizeof(*v)), MEMF_bits(32));
    1.15 +    if ( v != NULL )
    1.16          memset(v, 0, sizeof(*v));
    1.17      return v;
    1.18  }
    1.19  
    1.20  void free_vcpu_struct(struct vcpu *v)
    1.21  {
    1.22 -    xfree(v);
    1.23 +    free_xenheap_pages(v, get_order_from_bytes(sizeof(*v)));
    1.24  }
    1.25  
    1.26  #ifdef CONFIG_COMPAT