TDX MMU prep series part 1
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest18 patches 0 repliesNew
- v317 patches 29 repliesSuperseded
- v215 patches 42 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 16 patches | 135 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | KVM: x86/mmu: Zap invalid roots with mmu_lock holding for write at uninitarch/ arch/ arch/ | +13 | 0 replies | |
| 2/18 | KVM: Add member to struct kvm_gfn_range for target aliasarch/ include/ virt/ +1 more | +28 | 0 replies | |
| 3/18 | KVM: x86: Add a VM type define for TDXarch/ | +1 | 0 replies | |
| 4/18 | KVM: x86/mmu: Add an external pointer to struct kvm_mmu_pagearch/ arch/ arch/ +2 more | +45 | 0 replies | |
| 5/18 | KVM: x86/mmu: Add an is_mirror member for union kvm_mmu_page_rolearch/ arch/ arch/ | +12 | 0 replies | |
| 6/18 | KVM: x86/mmu: Make kvm_tdp_mmu_alloc_root() return voidarch/ arch/ arch/ | +6 | 0 replies | |
| 7/18 | KVM: x86/tdp_mmu: Take struct kvm in iter loopsarch/ arch/ | +21 | 0 replies | |
| 8/18 | KVM: x86/mmu: Support GFN direct bitsarch/ arch/ arch/ +3 more | +51 | 0 replies | |
| 9/18 | KVM: x86/tdp_mmu: Extract root invalid check from tdx_mmu_next_root()arch/ | +10 | 0 replies | |
| 10/18 | KVM: x86/tdp_mmu: Introduce KVM MMU root types to specify page table typearch/ arch/ | +28 | 0 replies | |
| 11/18 | KVM: x86/tdp_mmu: Take root in tdp_mmu_for_each_pte()arch/ | +8 | 0 replies | |
| 12/18 | KVM: x86/tdp_mmu: Support mirror root for TDP MMUarch/ arch/ arch/ +2 more | +94 | 0 replies | |
| 13/18 | KVM: x86/tdp_mmu: Propagate attr_filter to MMU notifier callbacksarch/ | +9 | 0 replies | |
| 14/18 | KVM: x86/tdp_mmu: Propagate building mirror page tablesarch/ arch/ arch/ | +94 | 0 replies | |
| 15/18 | KVM: x86/tdp_mmu: Propagate tearing down mirror page tablesarch/ arch/ arch/ | +60 | 0 replies | |
| 16/18 | KVM: x86/tdp_mmu: Take root types for kvm_tdp_mmu_invalidate_all_roots()arch/ arch/ arch/ | +22 | 0 replies | |
| 17/18 | KVM: x86/tdp_mmu: Don't zap valid mirror roots in kvm_tdp_mmu_zap_all()arch/ | +11 | 0 replies | |
| 18/18 | KVM: x86/mmu: Prevent aliased memslot GFNsarch/ arch/ arch/ | +15 | 0 replies |
Reviews trailers per patch
2 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Binbin Wu | Paolo Bonzini |
|---|---|---|
| 1/18 | ||
| 2/18 | ||
| 3/18 | ||
| 4/18 | R-b | |
| 5/18 | ||
| 6/18 | R-b | |
| 7/18 | ||
| 8/18 | ||
| 9/18 | ||
| 10/18 | ||
| 11/18 | ||
| 12/18 | ||
| 13/18 | ||
| 14/18 | ||
| 15/18 | ||
| 16/18 | ||
| 17/18 | ||
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/18] TDX MMU prep series part 1
Hi,
This is v4 of the TDX MMU prep series, split out of the giant 130 patch TDX base enabling series [0]. It is focusing on the changes to the x86 MMU to support TDX’s separation of private/shared EPT into separate roots. A future breakout series will include the changes to actually interact with the TDX module to actually map private memory.
There is a larger team working on TDX KVM base enabling. The patches were originally authored by Sean Christopherson and Isaku Yamahata, but otherwise it especially represents the work of Isaku and Yan Y Zhao and myself.
The series has been tested as part of a development branch for the TDX base series [1]. The testing of this series consists TDX kvm-unit-tests [2], regular KVM and TDX selftests, and booting a Linux TD.
Updates from v3
===============
For v4, we have a smattering of cosmetic changes and two issues worth elaborated on found by Yan.
1. Private memory was zapped as part of the MMU notifier release callback during VM destruction. This was previously rejected as a solution for a this cleanup for a couple of reasons. While the actual S-EPT cleanup is implemented in later latches, part of it is setup in "KVM: x86/tdp_mmu:
Take root types for kvm_tdp_mmu_invalidate_all_roots()". So the MMU notifier release patch is updated to not touch the valid mirror roots in this path.
2. A case was found where the memslot generation number could roll around and end up zapping the mirrored EPT. There actually was protection for this in v19 and it was thought to be not needed. So we added it back in mmu_alloc_direct_roots().
Also, some changes following the conversation in this max GFN thread [3]
1. Zap whole EPT GFN range in __tdp_mmu_zap_root()
2. Add patch for preventing memslots and fault with alias bits
This series is on top of the commit in kvm-coco-queue commit where it was previously applied (9a6ddc3e2e1e selftests: KVM: SEV-SNP test for KVM_SEV_INIT2).
Here is v3:
https://lore.kernel.org/kvm/[email protected]/
[0] https://lore.kernel.org/kvm/[email protected]/
[1] https://github.com/intel/tdx/tree/tdx_kvm_dev-2024-07-18
[2] https://lore.kernel.org/kvm/[email protected]/
[3] https://lore.kernel.org/kvm/[email protected]/
Isaku Yamahata (13):
KVM: Add member to struct kvm_gfn_range for target alias
KVM: x86/mmu: Add an external pointer to struct kvm_mmu_page
KVM: x86/mmu: Add an is_mirror member for union kvm_mmu_page_role
KVM: x86/tdp_mmu: Take struct kvm in iter loops
KVM: x86/mmu: Support GFN direct bits
KVM: x86/tdp_mmu: Extract root invalid check from tdx_mmu_next_root()
KVM: x86/tdp_mmu: Introduce KVM MMU root types to specify page table
type
KVM: x86/tdp_mmu: Take root in tdp_mmu_for_each_pte()
KVM: x86/tdp_mmu: Support mirror root for TDP MMU
KVM: x86/tdp_mmu: Propagate attr_filter to MMU notifier callbacks
KVM: x86/tdp_mmu: Propagate building mirror page tables
KVM: x86/tdp_mmu: Propagate tearing down mirror page tables
KVM: x86/tdp_mmu: Take root types for
kvm_tdp_mmu_invalidate_all_roots()
Rick Edgecombe (5):
KVM: x86/mmu: Zap invalid roots with mmu_lock holding for write at
uninit
KVM: x86: Add a VM type define for TDX
KVM: x86/mmu: Make kvm_tdp_mmu_alloc_root() return void
KVM: x86/tdp_mmu: Don't zap valid mirror roots in
kvm_tdp_mmu_zap_all()
KVM: x86/mmu: Prevent aliased memslot GFNs
arch/x86/include/asm/kvm-x86-ops.h | 4 + arch/x86/include/asm/kvm_host.h | 26 ++- arch/x86/include/uapi/asm/kvm.h | 1 + arch/x86/kvm/mmu.h | 31 +++ arch/x86/kvm/mmu/mmu.c | 50 ++++- arch/x86/kvm/mmu/mmu_internal.h | 64 +++++- arch/x86/kvm/mmu/spte.h | 5 + arch/x86/kvm/mmu/tdp_iter.c | 10 +- arch/x86/kvm/mmu/tdp_iter.h | 21 +- arch/x86/kvm/mmu/tdp_mmu.c | 323 ++++++++++++++++++++++------- arch/x86/kvm/mmu/tdp_mmu.h | 51 ++++- arch/x86/kvm/x86.c | 3 + include/linux/kvm_host.h | 6 + virt/kvm/guest_memfd.c | 2 + virt/kvm/kvm_main.c | 14 ++ 15 files changed, 506 insertions(+), 105 deletions(-)
base-commit: 9a6ddc3e2e1ebe37181c5fe9714d3a3590e3a792
Signature · 1 line
2.34.1