]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Refuse to load kvm_intel if EPT and NX are disabled
authorSean Christopherson <seanjc@google.com>
Tue, 15 Jun 2021 16:45:32 +0000 (09:45 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Jun 2021 10:24:49 +0000 (06:24 -0400)
commitb122dcce1b66a5d2cf32c52657b3241550fe346f
tree68dbc457bf3f12e8273ab34811d4bbc6a05f98cb
parent263fc49cc3bd6ad4dfcee8042d587e03e44d1984
KVM: VMX: Refuse to load kvm_intel if EPT and NX are disabled

Refuse to load KVM if NX support is not available and EPT is not enabled.
Shadow paging has assumed NX support since commit e4549f5d84d0 ("KVM:
vmx, svm: always run with EFER.NXE=1 when shadow paging is active"), so
for all intents and purposes this has been a de facto requirement for
over a year.

Do not require NX support if EPT is enabled purely because Intel CPUs let
firmware disable NX support via MSR_IA32_MISC_ENABLES.  If not for that,
VMX (and KVM as a whole) could require NX support with minimal risk to
breaking userspace.

Fixes: e4549f5d84d0 ("KVM: vmx, svm: always run with EFER.NXE=1 when shadow paging is active")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Message-Id: <20210615164535.2146172-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c