[kvm-unit-tests PATCH 1/2] x86: Skip some VMX control field tests

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

 



When the APIC virtualization address references unbacked memory, kvm
incorrectly fails a VM-entry with "invalid control field(s)." Until
this can be fixed, just skip the VMX control field tests that populate
a VMCS field with a physical address that isn't backed.

Tested: <multi line explanation of how the code was tested>

Effort: <Your effort group>
Google-Bug-Id: <buganizer-id>
Change-Id: I624091cb5cd7cfaae887de8f017e18b5f95d8f61
Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 x86/vmx_tests.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 088d32aaee0b..e82bc04d72e2 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -3359,6 +3359,12 @@ static void test_vmcs_page_addr(const char *name,
 				bool ignored,
 				u64 addr)
 {
+	/*
+	 * Skip tests that reference unbacked memory for now, because
+	 * kvm doesn't always handle this situation correctly.
+	 */
+	if (addr > fwcfg_get_u64(FW_CFG_RAM_SIZE) - PAGE_SIZE)
+		return;
 	report_prefix_pushf("%s = %lx", name, addr);
 	vmcs_write(encoding, addr);
 	test_vmx_controls(ignored || (IS_ALIGNED(addr, PAGE_SIZE) &&
-- 
2.14.1.690.gbb1197296e-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