[kvm-unit-tests PATCH 0/7] nVMX: Fix garbage "host addr size" tests

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

 



This started out as a "simple" fix for vCPUs without PCID, which thanks to
a bug on Alderlake/Raptorlake, are suddenly quite prevelant.  Then I got
the bright idea to tidy up a bit, and lo and behold, test_host_addr_size()
is full of garbage.

Patches 2 and 3 are cleanups to reduce indentation and help detect bogus
setups.

Patch 4 renames vmlaunch_succeeds(), which has bugged me forever, and would
get especially weird when the last patch adds a version that _must_ fail.

Patches 5-7 fix the HOST_RIP testcases.  Unsurpisingly, vmlaunch() writes
HOST_RIP to ensure the resulting VM-Exit doesn't go into the weeds, which
means the tests that write HOST_RIP and expect meaningful test coverage are
completely useless.  Patch 5 deliberately introduces a test failure by
exposing the underlying bugs related to the above.

I could have ordered the patches to not introduce the bug, but I'm more
than a bit annoyed at the moment, and I want to highlight the issue, as
not restoring/sanitizing state is a massive problem throughout KUT, and
the nVMX tests in particular are a horrible mess in this regard.

Patch 6 rips out the HOST_RIP tests that provide no meaningful coverage and
have no hope of passing.

Patch 7 fixes the noncanonical HOST_RIP testcase by using a bare VMLAUNCH.

Sean Christopherson (7):
  nVMX: Test CR4.PCIDE can be set for 64-bit host iff PCID is supported
  nVMX: Assert CR4.PAE is set when testing 64-bit host
  nVMX: Assert that the test is configured for 64-bit mode
  nVMX: Rename vmlaunch_succeeds() to vmlaunch()
  nVMX: Shuffle test_host_addr_size() tests to "restore" CR4 and RIP
  nVMX: Drop testcase that falsely claims to verify vmcs.HOST_RIP[63:32]
  nVMX: Fix the noncanonical HOST_RIP testcase

 x86/vmx_tests.c | 122 ++++++++++++++++++++++++++++--------------------
 1 file changed, 71 insertions(+), 51 deletions(-)


base-commit: e8f8554f810821e37f05112a46ae9775a029b5d1
-- 
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