]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: VMX: Disable unrestricted guest when EPT disabled
authorSheng Yang <sheng@linux.intel.com>
Fri, 27 Nov 2009 08:46:26 +0000 (16:46 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 30 Nov 2009 22:02:27 +0000 (20:02 -0200)
Otherwise would cause VMEntry failure when using ept=0 on unrestricted guest
supported processors.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index 80367c5ce8f4ebee0d8767bc4bffff6f8fea8370..1092e8ab02008a67badae116673a131d60660813 100644 (file)
@@ -2308,8 +2308,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;
                if (!ple_gap)