File 19372-2-on-3-shadow-mode-fix.patch of Package xen
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1237301760 0
# Node ID f3bdb4a66257ad67e380f4ac4ccd967bd309d4c1
# Parent d3a2bcff275c6a00c91133e9974f56454b4b79b5
x86 shadow: Fix 2-on-3 mode.
Signed-off-by: Gianluca Guida <Gianluca.Guida@eu.citrix.com>
xen-unstable changeset: 19372:0e8005a9d81201f5224e8fd0690a8b787befc4c0
xen-unstable date: Tue Mar 17 14:30:15 2009 +0000
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2759,16 +2759,15 @@ int sh_safe_not_to_sync(struct vcpu *v,
return 0;
smfn = _mfn(sp->up >> PAGE_SHIFT);
ASSERT(mfn_valid(smfn));
+#endif
-#if (GUEST_PAGING_LEVELS == 2)
+#if (GUEST_PAGING_LEVELS == 2 && SHADOW_PAGING_LEVELS == 3)
/* In 2-on-3 shadow mode the up pointer contains the link to the
* shadow page, but the shadow_table contains only the first of the
* four pages that makes the PAE top shadow tables. */
smfn = _mfn(mfn_x(smfn) & ~0x3UL);
#endif
-#endif
-
if ( pagetable_get_pfn(v->arch.shadow_table[0]) == mfn_x(smfn)
#if (SHADOW_PAGING_LEVELS == 3)
|| pagetable_get_pfn(v->arch.shadow_table[1]) == mfn_x(smfn)