From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH] KVM: VMX: Disable unrestricted guest when EPT disabled Date: Thu, 18 Mar 2010 14:11:19 +0800 Message-ID: <1268892679-20674-1-git-send-email-sheng@linux.intel.com> Cc: stable , kvm@vger.kernel.org, Avi Kivity , Marcelo Tosatti , Alexander Graf , Sheng Yang To: Greg KH Return-path: Received: from mga14.intel.com ([143.182.124.37]:49580 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204Ab0CRGLT (ORCPT ); Thu, 18 Mar 2010 02:11:19 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Otherwise would cause VMEntry failure when using ept=0 on unrestricted guest supported processors. Signed-off-by: Sheng Yang --- Please apply this to 2.6.32 stable. Thanks! Patch already in the upstream, commit: 046d87103addc117f0d397196e85189722d4d7de arch/x86/kvm/vmx.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 80367c5..1092e8a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2316,8 +2316,10 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx) ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; if (vmx->vpid == 0) exec_control &= ~SECONDARY_EXEC_ENABLE_VPID; - if (!enable_ept) + if (!enable_ept) { exec_control &= ~SECONDARY_EXEC_ENABLE_EPT; + enable_unrestricted_guest = 0; + } if (!enable_unrestricted_guest) exec_control &= ~SECONDARY_EXEC_UNRESTRICTED_GUEST; vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); -- 1.5.4.5