From: Avi Kivity Subject: [PATCH 4/4] KVM: VMX: When using ept, allow the guest to own cr4.pge Date: Mon, 7 Dec 2009 12:47:12 +0200 Message-ID: <1260182832-3974-5-git-send-email-avi@redhat.com> References: <1260182832-3974-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: Marcelo Tosatti , Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12529 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbZLGKrI (ORCPT ); Mon, 7 Dec 2009 05:47:08 -0500 In-Reply-To: <1260182832-3974-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/vmx.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d34fdd3..2e47e65 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2421,6 +2421,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; -- 1.6.5.3