x86: Allow PV superpages to work with live migration
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 18 May 2010 10:24:04 +0000 (11:24 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 18 May 2010 10:24:04 +0000 (11:24 +0100)
PV superpages currently do not work with live migration.  They fall
over dead when the shadow page table is enabled for dirty tracking.
The HVM support for superpages in this code has been tested and found
to work just fine for PV superpages.  This patch modifies the test
macro to allow the code to work with PV superpages.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/include/asm-x86/guest_pt.h

index dca50443000f55e6b1689dd6ad4377b6831981c4..e7814a9da285aa9d284b13fd5bc3400bc40c01bb 100644 (file)
@@ -186,10 +186,11 @@ guest_supports_superpages(struct vcpu *v)
     /* The _PAGE_PSE bit must be honoured in HVM guests, whenever
      * CR4.PSE is set or the guest is in PAE or long mode. 
      * It's also used in the dummy PT for vcpus with CR4.PG cleared. */
-    return (is_hvm_vcpu(v) && 
-            (GUEST_PAGING_LEVELS != 2 
-             || !hvm_paging_enabled(v)
-             || (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PSE)));
+    return (!is_hvm_vcpu(v)
+            ? opt_allow_hugepage
+            : (GUEST_PAGING_LEVELS != 2 
+               || !hvm_paging_enabled(v)
+               || (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PSE)));
 }
 
 static inline int