]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: WARN and reject loading KVM if NX is supported but not enabled
authorSean Christopherson <seanjc@google.com>
Tue, 15 Jun 2021 16:45:34 +0000 (09:45 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Jun 2021 10:24:50 +0000 (06:24 -0400)
commit52955a313c407a0271007641df5f7c1dde628e4d
treeb29d109013807d563aea7ff33c2b23e6a175a70a
parent1824f026e2727db2bfef59a3e3dbb89f198ab324
KVM: x86: WARN and reject loading KVM if NX is supported but not enabled

WARN if NX is reported as supported but not enabled in EFER.  All flavors
of the kernel, including non-PAE 32-bit kernels, set EFER.NX=1 if NX is
supported, even if NX usage is disable via kernel command line.  KVM relies
on NX being enabled if it's supported, e.g. KVM will generate illegal NPT
entries if nx_huge_pages is enabled and NX is supported but not enabled.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Message-Id: <20210615164535.2146172-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c