KVM: X86: Fix nested TDP error code info
Status from this message: Applied to kvm-x86 misc, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Changes in v4 from the cover letter
- Pass @from_hardware directly instead of stuff a flag in x86_exception.
- Use the bits in @access (thanks to MBEC+GMET) to get the fault stage.
- Check the entire PFEC/EXIT_QUAL in the selftest.
- Use hardware _or_ KVM information, never merge the two.
- Name the selftest nested_tdp_fault_test.
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | KVM: x86: Widen x86_exception's error_code to 64 bitsarch/ arch/ | +7 | 0 replies | |
| 2/5 | KVM: x86: Tell ->inject_page_fault() whether or a fault came from hardwarearch/ arch/ arch/ +2 more | +28 | 4 replies | |
| 3/5 | KVM: SVM: Fix nested NPF injection of PFERR_GUEST_{PAGE,FINAL}_MASK bitsarch/ arch/ arch/ | +31 | 4 replies | |
| 4/5 | KVM: VMX: Synthesize nested EPT violation GVA_IS_VALID/GVA_TRANSLATED bitsarch/ arch/ | +33 | 2 replies | |
| 5/5 | KVM: selftests: Add nested page fault injection testtools/ tools/ tools/ | +323 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/5] KVM: X86: Fix nested TDP error code info
Kevin's series to fix how KVM populates error information when injecting nested page faults (NPF on SVM, EPT violations on VMX) to L1 during instruction emulation.
See v3 for the full cover letter.
v4:
- Pass @from_hardware directly instead of stuff a flag in x86_exception.
- Use the bits in @access (thanks to MBEC+GMET) to get the fault stage.
- Check the entire PFEC/EXIT_QUAL in the selftest.
- Use hardware _or_ KVM information, never merge the two.
- Name the selftest nested_tdp_fault_test.
v3:
- https://lore.kernel.org/all/[email protected]
- Introduce hardware_nested_page_fault in struct x86_exception to distinguish hardware NPF/EPT exits from emulation-triggered faults as per Sean
- For SVM, take PFERR_GUEST_FAULT_STAGE bits from hardware exit_info_1 on hardware NPF exits, and from fault->error_code on emulation faults
- For VMX, conditionally OR hardware exit qualification GVA_IS_VALID/ GVA_TRANSLATED bits only for hardware EPT violation exits as per Sean
- Replace #if PTTYPE != PTTYPE_EPT preprocessor guards in paging_tmpl.h with runtime kvm_nested_fault_is_ept() helper that checks guest_mmu as per Sean
v2:
- https://lore.kernel.org/all/[email protected]
- Split out the widening of the x86_exception error code into a separate patch as per Sean.
- Added a WARN if both PFERR_GUEST_* bits are set and force the exit_info_1 to PFERR_GUEST_FINAL_MASK if this occurs.
- Removed the selftest TDP helpers as per Sean
- Added a patch to populate the EPT violation bits for VMX nested page faults as per Sean.
- Expanded the added selftest to support VMX and also added a test case for write protected pages using the INS instruction.
v1: https://lore.kernel.org/all/[email protected]
Kevin Cheng (4):
KVM: x86: Widen x86_exception's error_code to 64 bits
KVM: SVM: Fix nested NPF injection of PFERR_GUEST_{PAGE,FINAL}_MASK
bits
KVM: VMX: Synthesize nested EPT violation GVA_IS_VALID/GVA_TRANSLATED
bits
KVM: selftests: Add nested page fault injection test
Sean Christopherson (1):
KVM: x86: Tell ->inject_page_fault() whether or a fault came from
hardware
arch/x86/include/asm/kvm_host.h | 20 +- arch/x86/kvm/kvm_emulate.h | 2 +- arch/x86/kvm/mmu/paging_tmpl.h | 36 +- arch/x86/kvm/svm/nested.c | 38 ++- arch/x86/kvm/vmx/nested.c | 29 +- arch/x86/kvm/x86.c | 16 +- tools/testing/selftests/kvm/Makefile.kvm | 1 + .../selftests/kvm/include/x86/processor.h | 9 + .../selftests/kvm/x86/nested_tdp_fault_test.c | 313 ++++++++++++++++++ 9 files changed, 422 insertions(+), 42 deletions(-) create mode 100644 tools/testing/selftests/kvm/x86/nested_tdp_fault_test.c
base-commit: 66939c1603bd5579e63278f9dc72cba5b79da9b5
Signature · 1 line
2.54.0.794.g4f17f83d09-goog