[kvm-unit-tests PATCH 3/3] nVMX: Add a testcase for running L2 with EP4TA that points at MMIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
 x86/vmx_tests.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 9afca475..69a7c4a2 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4663,7 +4663,12 @@ static void test_ept_eptp(void)
 	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();
 
-- 
2.42.0.283.g2d96d420d3-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux