aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx/nested.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2021-06-09 16:42:35 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2021-06-17 13:09:54 -0400
commitc5ffd408cdc951ba153aea267d96d7cc62c6a97c (patch)
tree52701249eb9934062262bd24aa28c2d82e5fa5e9 /arch/x86/kvm/vmx/nested.c
parentKVM: nVMX: WARN if subtly-impossible VMFUNC conditions occur (diff)
downloadlinux-dev-c5ffd408cdc951ba153aea267d96d7cc62c6a97c.tar.xz
linux-dev-c5ffd408cdc951ba153aea267d96d7cc62c6a97c.zip
KVM: nVMX: Drop redundant checks on vmcs12 in EPTP switching emulation
Drop the explicit check on EPTP switching being enabled. The EPTP switching check is handled in the generic VMFUNC function check, while the underlying VMFUNC enablement check is done by hardware and redone by generic VMFUNC emulation. The vmcs12 EPT check is handled by KVM at VM-Enter in the form of a consistency check, keep it but add a WARN. Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20210609234235.1244004-16-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/vmx/nested.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index 6342bb4c46b3..b531e08a095b 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -5506,10 +5506,8 @@ static int nested_vmx_eptp_switching(struct kvm_vcpu *vcpu,
u32 index = kvm_rcx_read(vcpu);
u64 new_eptp;
- if (!nested_cpu_has_eptp_switching(vmcs12) ||
- !nested_cpu_has_ept(vmcs12))
+ if (WARN_ON_ONCE(!nested_cpu_has_ept(vmcs12)))
return 1;
-
if (index >= VMFUNC_EPTP_ENTRIES)
return 1;