nVMX: Add a testcase for running L2 with EP4TA that points at MMIO
Add a testcase in test_ept_eptp() to verify that KVM doesn't inject a
triple fault (or any other unexpected "error") if L1 runs L2 with an
EP4TA that points at MMIO memory. For a very, very long time, KVM
synthesized a triple fault in response to a "legal-but-garbage" EP4TA
_before_ completing emulation of nested VM-Enter, which is architectural
wrong and triggered various warnings in KVM.
Use the TPM base address for the MMIO backing, as KVM doesn't emulate a
TPM (in-kernel) and practically the address is guaranteed to be MMIO.
Drop the manual test for 4-level EPT support, as __setup_ept() performs
said check/test.
Link: https://lore.kernel.org/all/20230729005200.1057358-6-seanjc@google.com
Link: https://lore.kernel.org/r/20230911182013.333559-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 7eb0d11..7fdc605 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4663,7 +4663,12 @@
u32 i, maxphysaddr;
u64 j, resv_bits_mask = 0;
- report(is_4_level_ept_supported(), "4-level EPT support check");
+ if (__setup_ept(0xfed40000, false)) {
+ report_skip("%s : EPT not supported", __func__);
+ return;
+ }
+
+ test_vmx_valid_controls();
setup_dummy_ept();