linux/arch/x86/kvm
Sean Christopherson 4f76285f6d KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs
commit 112022bdb5bc372e00e6e43cb88ee38ea67b97bd upstream

Mark NX as being used for all non-nested shadow MMUs, as KVM will set the
NX bit for huge SPTEs if the iTLB mutli-hit mitigation is enabled.
Checking the mitigation itself is not sufficient as it can be toggled on
at any time and KVM doesn't reset MMU contexts when that happens.  KVM
could reset the contexts, but that would require purging all SPTEs in all
MMUs, for no real benefit.  And, KVM already forces EFER.NX=1 when TDP is
disabled (for WP=0, SMEP=1, NX=0), so technically NX is never reserved
for shadow MMUs.

Fixes: b8e8c8303f ("kvm: mmu: ITLB_MULTIHIT mitigation")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[sudip: use old path]
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-03 10:08:16 +02:00
..
vmx KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation 2021-08-18 08:57:03 +02:00
Kconfig
Makefile
cpuid.c KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled 2021-07-20 16:10:40 +02:00
cpuid.h
debugfs.c
emulate.c
hyperv.c
hyperv.h
i8254.c
i8254.h
i8259.c
ioapic.c x86/kvm: fix vcpu-id indexed array sizes 2021-08-04 12:27:37 +02:00
ioapic.h x86/kvm: fix vcpu-id indexed array sizes 2021-08-04 12:27:37 +02:00
irq.c
irq.h
irq_comm.c
kvm_cache_regs.h
lapic.c
lapic.h
mmu.c KVM: x86/mmu: Treat NX as used (not reserved) for all !TDP shadow MMUs 2021-09-03 10:08:16 +02:00
mmu.h
mmu_audit.c
mmutrace.h
mtrr.c
page_track.c
paging_tmpl.h KVM: X86: MMU: Use the correct inherited permissions to get shadow page 2021-08-15 13:08:04 +02:00
pmu.c
pmu.h
pmu_amd.c
svm.c KVM: nSVM: always intercept VMLOAD/VMSAVE when nested (CVE-2021-3656) 2021-08-18 08:57:04 +02:00
trace.h
tss.h
x86.c KVM: x86: accept userspace interrupt only if no event is injected 2021-08-12 13:21:03 +02:00
x86.h