RFC TDX KVM selftests
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest17 patches 5 repliesIn review
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | KVM: selftests: Add support for creating non-default type VMstools/ tools/ | +7 | 0 replies | |
| 2/17 | KVM: selftest: Add helper functions to create TDX VMstools/ tools/ tools/ +3 more | +459 | 2 replies | |
| 3/17 | KVM: selftest: Adding TDX life cycle test.tools/ tools/ tools/ | +254 | 2 replies | |
| 4/17 | KVM: selftest: TDX: Add report_fatal_error testtools/ tools/ | +72 | 0 replies | |
| 5/17 | KVM: selftest: Adding test case for TDX port IOtools/ tools/ | +109 | 0 replies | |
| 6/17 | KVM: selftest: TDX: Add basic TDX CPUID testtools/ tools/ | +145 | 0 replies | |
| 7/17 | KVM: selftest: TDX: Add basic get_td_vmcall_info testtools/ tools/ | +150 | 0 replies | |
| 8/17 | KVM: selftest: TDX: Add TDX IO writes testtools/ tools/ | +88 | 0 replies | |
| 9/17 | KVM: selftest: TDX: Add TDX IO reads testtools/ | +84 | 0 replies | |
| 10/17 | KVM: selftest: TDX: Add TDX MSR read/write teststools/ tools/ | +263 | 0 replies | |
| 11/17 | KVM: selftest: TDX: Add TDX HLT exit testtools/ tools/ | +104 | 0 replies | |
| 12/17 | KVM: selftest: TDX: Add TDX MMIO reads testtools/ tools/ | +134 | 0 replies | |
| 13/17 | KVM: selftest: TDX: Add TDX MMIO writes testtools/ tools/ | +110 | 0 replies | |
| 14/17 | KVM: selftest: TDX: Add TDX CPUID TDVMCALL testtools/ tools/ | +125 | 0 replies | |
| 15/17 | KVM: selftest: TDX: Verify the behavior when host consumes a TD private memorytools/ | +93 | 0 replies | |
| 16/17 | KVM: selftest: TDX: Add TDG.VP.INFO testtools/ tools/ tools/ | +235 | 0 replies | |
| 17/17 | KVM: selftest: TDX: Add shared memory testtools/ tools/ tools/ | +192 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC PATCH v2 00/17] TDX KVM selftests
Hello,
This is v2 of the patch series for TDX selftests.
It is based on v5.19-rc8 and Intel's V8 of the TDX host patches which was proposed in https://lkml.org/lkml/2022/8/8/877
The tree can be found at
https://github.com/googleprodkernel/linux-cc/tree/selftests
Major changes vrom v1:
- rebased to v5.19
- added helpers for success and failure reporting
- added additional test cases
---
TDX stands for Trust Domain Extensions which isolates VMs from the virtual-machine manager (VMM)/hypervisor and any other software on the platform.
Intel has recently submitted a set of RFC patches for KVM support for TDX and more information can be found on the latest TDX Support
Patches: https://lkml.org/lkml/2022/8/8/877
Due to the nature of the confidential computing environment that TDX provides, it is very difficult to verify/test the KVM support. TDX requires UEFI and the guest kernel to be enlightened which are all under development.
We are working on a set of selftests to close this gap and be able to verify the KVM functionality to support TDX lifecycle and GHCI [1] interface.
We are looking for any feedback on:
- Patch series itself
- Any suggestion on how we should approach testing TDX functionality. Does selftests seems reasonable or should we switch to using KVM unit tests. I would be happy to get some perspective on how KVM unit tests can help us more.
- Any test case or scenario that we should add.
- Anything else I have not thought of yet.
Current patch series provide the following capabilities:
- Provide helper functions to create a TD (Trusted Domain) using the KVM ioctls
- Provide helper functions to create a guest image that can include any testing code
- Provide helper functions and wrapper functions to write testing code using GHCI interface
- Add a test case that verifies TDX life cycle
- Add a test case that verifies TDX GHCI port IO
TODOs:
- Use existing function to create page tables dynamically (ie __virt_pg_map())
- Remove arbitrary defined magic numbers for data structure offsets
- Add TDVMCALL for error reporting
- Add additional test cases as some listed below
- Add #VE handlers to help testing more complicated test cases
---
Erdem Aktas (4):
KVM: selftests: Add support for creating non-default type VMs
KVM: selftest: Add helper functions to create TDX VMs
KVM: selftest: Adding TDX life cycle test.
KVM: selftest: Adding test case for TDX port IO
Roger Wang (1):
KVM: selftest: TDX: Add TDG.VP.INFO test
Ryan Afranji (2):
KVM: selftest: TDX: Verify the behavior when host consumes a TD
private memory
KVM: selftest: TDX: Add shared memory test
Sagi Shahar (10):
KVM: selftest: TDX: Add report_fatal_error test
KVM: selftest: TDX: Add basic TDX CPUID test
KVM: selftest: TDX: Add basic get_td_vmcall_info test
KVM: selftest: TDX: Add TDX IO writes test
KVM: selftest: TDX: Add TDX IO reads test
KVM: selftest: TDX: Add TDX MSR read/write tests
KVM: selftest: TDX: Add TDX HLT exit test
KVM: selftest: TDX: Add TDX MMIO reads test
KVM: selftest: TDX: Add TDX MMIO writes test
KVM: selftest: TDX: Add TDX CPUID TDVMCALL test
tools/testing/selftests/kvm/Makefile | 2 + .../selftests/kvm/include/kvm_util_base.h | 12 +- .../selftests/kvm/include/x86_64/processor.h | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 6 +- .../selftests/kvm/lib/x86_64/processor.c | 27 + tools/testing/selftests/kvm/lib/x86_64/tdx.h | 495 +++++ .../selftests/kvm/lib/x86_64/tdx_lib.c | 373 ++++ .../selftests/kvm/x86_64/tdx_vm_tests.c | 1666 +++++++++++++++++ 8 files changed, 2577 insertions(+), 5 deletions(-) create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx.h create mode 100644 tools/testing/selftests/kvm/lib/x86_64/tdx_lib.c create mode 100644 tools/testing/selftests/kvm/x86_64/tdx_vm_tests.c
Signature · 1 line
2.37.2.789.g6183377224-goog