Skip to contentSkip to conversation

Fix 2-on-3 shadow mode.

PATCH New Gianluca Guida 1 participant 1 message Mar 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 2-on-3 shadow mode.

A wrong #ifdef in multi.c may cause memory corruption in some 32 bit HVM guests.

This patch fixes it, and should be applied hopefully to xen-3.3 and unstable.

Thanks,
Gianluca

xen/arch/x86/mm/shadow/multi.c +3 -4
diff -r 587e81dd3540 xen/arch/x86/mm/shadow/multi.c
@@ -2753,14 +2753,13 @@ int sh_safe_not_to_sync(struct vcpu *v, 
         return 0;
     smfn = _mfn(sp->up >> PAGE_SHIFT);
     ASSERT(mfn_valid(smfn));
-
-#if (GUEST_PAGING_LEVELS == 2)
+#endif
+
+#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)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel