]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: VMX: When using ept, allow the guest to own cr4.pge
authorAvi Kivity <avi@redhat.com>
Mon, 7 Dec 2009 10:29:14 +0000 (12:29 +0200)
committerAvi Kivity <avi@redhat.com>
Tue, 15 Dec 2009 10:42:51 +0000 (12:42 +0200)
We make no use of cr4.pge if ept is enabled, but the guest does (to flush
global mappings, as with vmap()), so give the guest ownership of this bit.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c

index c81043c671c5a2ca52a6dedd471862d893425bed..74e593e4415d25322434c5c14602086ee1302d5e 100644 (file)
@@ -2423,6 +2423,8 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
 
        vmcs_writel(CR0_GUEST_HOST_MASK, ~0UL);
        vmx->vcpu.arch.cr4_guest_owned_bits = KVM_CR4_GUEST_OWNED_BITS;
+       if (enable_ept)
+               vmx->vcpu.arch.cr4_guest_owned_bits |= X86_CR4_PGE;
        vmcs_writel(CR4_GUEST_HOST_MASK, ~vmx->vcpu.arch.cr4_guest_owned_bits);
 
        tsc_base = vmx->vcpu.kvm->arch.vm_init_tsc;