From: Keir Fraser Date: Thu, 6 Dec 2007 16:50:13 +0000 (+0000) Subject: x86, 32-on-64: Improve checking in vcpu_destroy_pagetables(). It *is* X-Git-Tag: 3.1.3-rc1~93 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=be02c66e75b38b66221c3848532af60a608853b3;p=people%2Fvhanquez%2Fxen.git 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 Signed-off-by: Keir Fraser xen-unstable changeset: 16401:f62e6c697eeb68a7a62f4beb87e85a68b91b3c6a xen-unstable date: Tue Nov 20 15:34:25 2007 +0000 --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index dbaf67bb3..c5ae4f8ae 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1624,10 +1624,6 @@ static void vcpu_destroy_pagetables(struct vcpu *v) put_page(mfn_to_page(pfn)); else put_page_and_type(mfn_to_page(pfn)); -#ifdef __x86_64__ - if ( pfn == pagetable_get_pfn(v->arch.guest_table_user) ) - v->arch.guest_table_user = pagetable_null(); -#endif v->arch.guest_table = pagetable_null(); } @@ -1636,10 +1632,13 @@ static void vcpu_destroy_pagetables(struct vcpu *v) pfn = pagetable_get_pfn(v->arch.guest_table_user); if ( pfn != 0 ) { - if ( paging_mode_refcounts(d) ) - put_page(mfn_to_page(pfn)); - else - put_page_and_type(mfn_to_page(pfn)); + if ( !is_pv_32bit_vcpu(v) ) + { + if ( paging_mode_refcounts(d) ) + put_page(mfn_to_page(pfn)); + else + put_page_and_type(mfn_to_page(pfn)); + } v->arch.guest_table_user = pagetable_null(); } #endif