Skip to content

nSVM: NPT improvements and cleanups

Sean Christopherson kvm 1 version Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/12nSVM: Provide expected and actual exit codes on VMRUN test failurex86/svm_tests.c+4 -20 replies
2/12nSVM: Replace open coded NX manipulation with appropriate macrosx86/svm_tests.c+3 -30 replies
3/12nSVM: Reset the VMCB before every v1 testx86/svm.c x86/svm_tests.c+2 -130 replies
4/12nSVM: Explicitly save/update/restore EFER.NX for NPT NX testx86/svm_tests.c+5 -10 replies
5/12nSVM: Remove NPT reserved bits tests (new one on the way)x86/svm_tests.c+0 -455 replies
6/12nSVM: Stop forcing EFER.NX=1 for all testsx86/svm.c+1 -20 replies
7/12nSVM: Remove a superfluous modification of guest EFER.NX in NPT NX testx86/svm_tests.c+0 -20 replies
8/12nSVM: Clear guest's EFER.NX in NPT NX testx86/svm_tests.c+3 -00 replies
9/12lib/vmalloc: Let arch code pass a value to its setup_mmu() helperlib/arm/mmu.c lib/s390x/mmu.c lib/vmalloc.c +3 more+15 -70 replies
10/12x86: Let tests omit PT_USER_MASK when configuring virtual memorylib/x86/vm.c+11 -40 replies
11/12x86: Add GBPAGES CPUID macro, clean up CPUID commentslib/x86/processor.h+8 -70 replies
12/12nSVM: Add test for NPT reserved bit and #NPF error code behaviorx86/svm.c x86/svm_tests.c+147 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [kvm-unit-tests PATCH 00/12] nSVM: NPT improvements and cleanups

The first chunk of this series (everything up to the lib/vmalloc patch) are cleanups and bug fixes for existing nSVM tests that I collected on my first attempt at the new NPT test. I originally wanted to piggyback the existing "v1" nSVM tests and implemented the fixes/cleanups, but that approach didn't go so well because of the v1 infrastructure limitations.

The common lib/vmalloc changes are to allow arch code to pass arbitrary data to its setup_mmu() function. x86-64 uses the param to avoid marking PTEs a USER so that tests can enable SMEP (#PF if supervisor mode fetches from a USER PTE) without exploding or having to duplicate all page tables.

The "new" test targets nested NPT by running L1 and L2 with different EFER.NX and CR4.SMEP settings to verify that KVM uses the correct MMU settings when injecting page faults.

Sean Christopherson (12):
nSVM: Provide expected and actual exit codes on VMRUN test failure
nSVM: Replace open coded NX manipulation with appropriate macros
nSVM: Reset the VMCB before every v1 test
nSVM: Explicitly save/update/restore EFER.NX for NPT NX test
nSVM: Remove NPT reserved bits tests (new one on the way)
nSVM: Stop forcing EFER.NX=1 for all tests
nSVM: Remove a superfluous modification of guest EFER.NX in NPT NX
test
nSVM: Clear guest's EFER.NX in NPT NX test
lib/vmalloc: Let arch code pass a value to its setup_mmu() helper
x86: Let tests omit PT_USER_MASK when configuring virtual memory
x86: Add GBPAGES CPUID macro, clean up CPUID comments
nSVM: Add test for NPT reserved bit and #NPF error code behavior

 lib/arm/mmu.c       |   2 +-
 lib/s390x/mmu.c     |   3 +-
 lib/vmalloc.c       |   9 +-
 lib/vmalloc.h       |   4 +-
 lib/x86/processor.h |  15 +--
 lib/x86/vm.c        |  15 ++-
 s390x/uv-host.c     |   2 +-
 x86/svm.c           |  10 +-
 x86/svm_tests.c     | 220 +++++++++++++++++++++++++++++++-------------
 9 files changed, 196 insertions(+), 84 deletions(-)
Signature · 1 line
2.32.0.288.g62a8d224e6-goog