ia64/xen-unstable

changeset 16406:f62e6c697eeb

x86, 32-on-64: Improve checking in vcpu_destroy_pagetables(). It *is*
possible for 64-bit guest to have matching guest_table and
guest_table_user.
Original patch by John Levon <levon@movementarian.org>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Nov 20 15:34:25 2007 +0000 (2007-11-20)
parents 94b3979606cd
children 2e5d922b7ee3
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Tue Nov 20 15:18:09 2007 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Tue Nov 20 15:34:25 2007 +0000
     1.3 @@ -1756,10 +1756,6 @@ static void vcpu_destroy_pagetables(stru
     1.4              put_page(mfn_to_page(pfn));
     1.5          else
     1.6              put_page_and_type(mfn_to_page(pfn));
     1.7 -#ifdef __x86_64__
     1.8 -        if ( pfn == pagetable_get_pfn(v->arch.guest_table_user) )
     1.9 -            v->arch.guest_table_user = pagetable_null();
    1.10 -#endif
    1.11          v->arch.guest_table = pagetable_null();
    1.12      }
    1.13  
    1.14 @@ -1768,10 +1764,13 @@ static void vcpu_destroy_pagetables(stru
    1.15      pfn = pagetable_get_pfn(v->arch.guest_table_user);
    1.16      if ( pfn != 0 )
    1.17      {
    1.18 -        if ( paging_mode_refcounts(d) )
    1.19 -            put_page(mfn_to_page(pfn));
    1.20 -        else
    1.21 -            put_page_and_type(mfn_to_page(pfn));
    1.22 +        if ( !is_pv_32bit_vcpu(v) )
    1.23 +        {
    1.24 +            if ( paging_mode_refcounts(d) )
    1.25 +                put_page(mfn_to_page(pfn));
    1.26 +            else
    1.27 +                put_page_and_type(mfn_to_page(pfn));
    1.28 +        }
    1.29          v->arch.guest_table_user = pagetable_null();
    1.30      }
    1.31  #endif