Skip to content

Improve test parity between SVM and VMX

Kevin Cheng kvm 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 1 replyIn review
  2. v210 patches 1 replySuperseded
  3. v19 patches 1 replySuperseded

Changes in v3 from the cover letter

- Open code assembly instructions in svm_ud_test as per Sean.
- Removed unnecessary separate config for svm_ud_test as per Sean.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10x86/svm: Fix virq_inject SVM test failurex86/svm_tests.c+3 -10 replies
2/10x86/nSVM: Add test for NPT A/D bitsx86/svm_npt.c+178 -00 replies
3/10x86/svm: Add tests for APIC passthroughx86/svm_tests.c+175 -00 replies
4/10x86/nSVM: Add tests for instruction interruptslib/x86/processor.h x86/svm.c x86/svm.h +3 more+244 -60 replies
5/10x86/svm: Add tests for PF exception testingx86/Makefile.common x86/svm.h x86/svm_tests.c +1 more+106 -10 replies
6/10x86/svm: Extend NPT test coverage for different page table levelslib/x86/vm.c lib/x86/vm.h x86/access.c +4 more+333 -660 replies
7/10x86/svm: Add NPT ignored bits testx86/svm_npt.c+30 -00 replies
8/10x86/svm: Add testing for NPT permissions on guest page tablesx86/svm_npt.c+221 -20 replies
9/10x86/svm: Add event injection check testslib/x86/processor.h x86/svm_tests.c x86/unittests.cfg+137 -720 replies
10/10x86/svm: Add test for #UD when EFER.SVME=0x86/svm_tests.c+17 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [kvm-unit-tests PATCH v3 00/10] Improve test parity between SVM and VMX

This series introduces numerous tests for features that VMX testing covers but current SVM testing lacks.

I went through all VMX tests and identified which ones could have an equivalent test written for SVM.

This series also includes some canonicalization and consistency check tests as defined by the AMD APM.

v2 -> v3:
- Open code assembly instructions in svm_ud_test as per Sean.
- Removed unnecessary separate config for svm_ud_test as per Sean.

v2: https://lore.kernel.org/all/[email protected]/

v1 -> v2:
- Renamed check_npt_ad_pte() to found_bad_npt_ad().
- Renamed test_event_injection() to svm_event_injection() and removed the test from the svm suite to run separately.
- For the svm_event_injection test, injecting the CP vector now relies on shadow stack capabilities as suggested by Yosry.
- Added a new test for verifying that certain instructions generate a #UD when EFER.SVME=0. This is a regression test in response to a fix that is currently under review [1]

[1] https://lore.kernel.org/all/[email protected]/

v1: https://lore.kernel.org/all/[email protected]/

Kevin Cheng (10):
x86/svm: Fix virq_inject SVM test failure
x86/nSVM: Add test for NPT A/D bits
x86/svm: Add tests for APIC passthrough
x86/nSVM: Add tests for instruction interrupts x86/svm: Add tests for PF exception testing
x86/svm: Extend NPT test coverage for different page table levels x86/svm: Add NPT ignored bits test
x86/svm: Add testing for NPT permissions on guest page tables x86/svm: Add event injection check tests
x86/svm: Add test for #UD when EFER.SVME=0

 lib/x86/processor.h |  11 +
 lib/x86/vm.c        |   2 +-
 lib/x86/vm.h        |   2 +
 x86/Makefile.common |   2 +
 x86/access.c        |   7 -
 x86/access.h        |  11 +
 x86/svm.c           |  16 +-
 x86/svm.h           |   9 +
 x86/svm_npt.c       | 801 ++++++++++++++++++++++++++++++++++++++++----
 x86/svm_tests.c     | 664 ++++++++++++++++++++++++++++++++----
 x86/unittests.cfg   |  54 ++-
 x86/vmx_tests.c     |   5 -
 12 files changed, 1440 insertions(+), 144 deletions(-)

--
2.53.0.851.ga537e3e6e9-goog