[RFC 0/5] SEV Kernel Selftests

From: Pratik R. Sampat
Date: Wed Jul 10 2024 - 18:06:08 EST


This patchset introduces SEV-SNP test to the kernel selftest framework.
It also adds negative testing of SEV, ES and SNP VM types.

Patch 1 - Extend the sev smoke tests to use the SNP specific ioctl
calls and sets up memory to boot a SNP guest VM
Patch 2 - Cleanup patch that decouples the ioctl calls from the sev
selftest library with its test assert and status counterparts. No
functional change introduced
Patch 3 - Introduce ioctl test for SEV, ES
Patch 4 - Introduce positive and negative ioctl test for SEV-SNP
Patch 5 - Adds the X86_FEATURE_SEV_SNP vm type test for KVM_SEV_INIT2

Any feedback/review on the approach and design is highly appreciated!

Pratik R. Sampat (5):
selftests: KVM: Add a basic SNP smoke test
selftests: KVM: Decouple SEV ioctls from asserts
selftests: KVM: SEV IOCTL test
selftests: KVM: SNP IOCTL test
selftests: KVM: SEV-SNP test for KVM_SEV_INIT2

.../selftests/kvm/include/x86_64/processor.h | 1 +
.../selftests/kvm/include/x86_64/sev.h | 39 ++-
tools/testing/selftests/kvm/lib/kvm_util.c | 7 +-
.../selftests/kvm/lib/x86_64/processor.c | 6 +-
tools/testing/selftests/kvm/lib/x86_64/sev.c | 181 +++++++++++---
.../selftests/kvm/x86_64/sev_init2_tests.c | 13 +
.../selftests/kvm/x86_64/sev_smoke_test.c | 223 +++++++++++++++++-
7 files changed, 418 insertions(+), 52 deletions(-)

--
2.34.1