Skip to content

VMX framework enhancements and new tests

David Matlack kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest32 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32x86: add test filter to vmx.flat.x86/vmx.c+37 -20 replies
2/32x86: add config for each vmx unit test casex86/unittests.cfg x86/vmx_tests.c+87 -20 replies
3/32x86: move basic vmx tests into separate test casesx86/unittests.cfg x86/vmx.c+84 -160 replies
4/32x86: add missing vmx test cases to unittests.cfgx86/unittests.cfg+24 -00 replies
5/32lib: better test name filteringlib/libcflat.h lib/string.c x86/vmx.c+70 -250 replies
6/32x86: vmx: filter exit_monitor_from_l2_test from full vmx testx86/unittests.cfg+1 -11 reply
7/32x86: test exit while vmcs02 is loadedx86/vmx_tests.c+14 -00 replies
8/32x86: Adding gtest to check correct instruction error is returnedx86/vmx.c x86/vmx.h+34 -00 replies
9/32x86: basic vmwrite/vmread testx86/unittests.cfg x86/vmx.c x86/vmx.h+275 -100 replies
10/32x86: vmcs lifecycle testx86/unittests.cfg x86/vmx.c+66 -00 replies
11/32x86: test VMCS in memory after VMCLEARx86/vmx.c+37 -00 replies
12/32x86: test VMPTRLD does not drop VMWRITEsx86/vmx.c+6 -10 replies
13/32x86: don't special case vmx null testx86/unittests.cfg x86/vmx.c x86/vmx_tests.c+11 -210 replies
14/32x86: factor out vmx_enter_guestx86/vmx.c+41 -340 replies
15/32x86: binstr utility functionlib/libcflat.h lib/printf.c+37 -00 replies
16/32x86: vmx exit reason descriptionsx86/vmx.c x86/vmx.h+79 -10 replies
17/32x86: v2 vmx test frameworkx86/unittests.cfg x86/vmx.c x86/vmx.h +1 more+343 -20 replies
18/32lib: provide stdio.hlib/stdio.h+4 -03 replies
19/32lib: added assert_msg macrolib/libcflat.h+10 -01 reply
20/32lib: fix *printf return valuelib/printf.c+0 -11 reply
21/32lib: printf-style report prefixeslib/libcflat.h lib/report.c+34 -54 replies
22/32lib: add newline to assert_msglib/libcflat.h+1 -12 replies
23/32lib: x86: store free pages in ascending orderlib/x86/vm.c+22 -50 replies
24/32lib: x86: multi-page allocatorlib/x86/vm.c lib/x86/vm.h+58 -00 replies
25/32x86: ept assertionsx86/vmx.c x86/vmx.h+13 -121 reply
26/32x86: setup_ept code motionx86/vmx_tests.c+8 -60 replies
27/32x86: 2GiB RAM for vmx testsx86/unittests.cfg+1 -12 replies
28/32x86: ept capability utilitiesx86/vmx.c x86/vmx.h x86/vmx_tests.c+38 -40 replies
29/32lib: x86: page table utilitieslib/x86/vm.c lib/x86/vm.h+108 -180 replies
30/32x86: ept access testslib/x86/asm/page.h x86/unittests.cfg x86/vmx.h +1 more+962 -00 replies
31/32x86: force ept 2m testx86/unittests.cfg x86/vmx_tests.c+19 -00 replies
32/32lib: add report_passlib/libcflat.h lib/report.c x86/vmx.h+11 -00 replies

Reviews trailers per patch

3 of 32 patches have a Reviewed-by or Acked-by.

PatchAndrew Jones
1/32
2/32
3/32
4/32
5/32
6/32
7/32
8/32
9/32
10/32
11/32
12/32
13/32
14/32
15/32
16/32
17/32
18/32
19/32R-b
20/32R-b
21/32R-b
22/32
23/32
24/32
25/32
26/32
27/32
28/32
29/32
30/32
31/32
32/32

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [kvm-unit-tests PATCH 00/32] VMX framework enhancements and new tests

Patches 1-6 split out the VMX tests into their own unit tests.

Patches 7-12 add new VMX unit tests.

Patches 13-17 implement a new VMX test framework ("v2"). Instead of registering a main function and an exit handler, entering and exiting guest mode is accomplished by calling a function, enter_guest().

Patches 18-22 add some assert and printf enhancements to lib/.

Patches 23-32 add EPT access tests, using the v2 framework.

4 of the EPT access tests reveal KVM bugs (4.11-rc6, on a Haswell CPU):
vmx_ept_access_test_execute_only vmx_ept_access_test_paddr_not_present_ad_disabled vmx_ept_access_test_paddr_read_only_ad_disabled vmx_ept_access_test_paddr_read_execute_ad_disabled

The rest of the new tests in this series pass.

David Matlack (8):
x86: move basic vmx tests into separate test cases
x86: add missing vmx test cases to unittests.cfg
x86: vmx: filter exit_monitor_from_l2_test from full vmx test
x86: basic vmwrite/vmread test
x86: vmcs lifecycle test
x86: test VMCS in memory after VMCLEAR
x86: test VMPTRLD does not drop VMWRITEs
lib: add report_pass

GanShun (1):
x86: Adding gtest to check correct instruction error is returned

Peter Feiner (23):
x86: add test filter to vmx.flat.
x86: add config for each vmx unit test case
lib: better test name filtering
x86: test exit while vmcs02 is loaded
x86: don't special case vmx null test
x86: factor out vmx_enter_guest
x86: binstr utility function
x86: vmx exit reason descriptions
x86: v2 vmx test framework
lib: provide stdio.h
lib: added assert_msg macro
lib: fix *printf return value
lib: printf-style report prefixes
lib: add newline to assert_msg
lib: x86: store free pages in ascending order
lib: x86: multi-page allocator
x86: ept assertions
x86: setup_ept code motion
x86: 2GiB RAM for vmx tests
x86: ept capability utilities
lib: x86: page table utilities
x86: ept access tests
x86: force ept 2m test

 lib/libcflat.h     |  21 ++
 lib/printf.c       |  31 +-
 lib/report.c       |  45 ++-
 lib/stdio.h        |   4 +
 lib/string.c       |  41 +++
 lib/x86/asm/page.h |   2 +
 lib/x86/vm.c       | 183 ++++++++--
 lib/x86/vm.h       |  28 ++
 x86/unittests.cfg  | 291 +++++++++++++++-
 x86/vmx.c          | 833 +++++++++++++++++++++++++++++++++++++++-----
 x86/vmx.h          | 151 +++++++-
 x86/vmx_tests.c    | 989 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 12 files changed, 2493 insertions(+), 126 deletions(-)
 create mode 100644 lib/stdio.h
Signature · 1 line
2.12.2.816.g2cccc81164-goog