KVM: x86: Dynamically allocate hashed page list
Status from this message: Applied to kvm-x86 mmu, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest4 patches 9 repliesApplied
- v33 patches 15 repliesSuperseded
- v23 patches 12 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 2 replies | Superseded |
Changes in v4 from the cover letter
- Use smp_store_release() and smp_load_acquire() instead of {READ,WRITE}_ONCE, and update the comments accordingly. [Paolo, James]
- Move the kvm_tdx assert to tdx.c. [Paolo]
- Fix the assertion, again. [Vipin, in spirit if not in reality]
- Add a patch to move TDX hardware setup to tdx.c.
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | KVM: TDX: Move TDX hardware setup from main.c to tdx.carch/ arch/ arch/ +1 more | +35 | 3 replies | |
| 2/4 | KVM: x86/mmu: Dynamically allocate shadow MMU's hashed page listarch/ arch/ arch/ | +28 | 3 replies | |
| 3/4 | KVM: x86: Use kvzalloc() to allocate VM structarch/ arch/ arch/ +2 more | +29 | 1 reply | |
| 4/4 | KVM: x86/mmu: Defer allocation of shadow MMU's hashed page listarch/ | +52 | 0 replies |
Reviews trailers per patch
3 of 4 patches have a Reviewed-by or Acked-by.
| Patch | Xiaoyao Li | Kai Huang |
|---|---|---|
| 1/4 | R-b | R-b |
| 2/4 | R-b | |
| 3/4 | R-b | |
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/4] KVM: x86: Dynamically allocate hashed page list
Allocate the hashed list of shadow pages dynamically (separate from struct kvm), and on-demand. The hashed list is 32KiB, i.e. absolutely belongs in a separate allocation, and is worth skipping if KVM isn't shadowing guest PTEs for the VM.
I double checked that padding kvm_arch with a 4KiB array trips the assert, but padding with 2KiB does not. So knock on wood, I finally got the assert right. Maybe.
v4:
- Use smp_store_release() and smp_load_acquire() instead of {READ,WRITE}_ONCE, and update the comments accordingly. [Paolo, James]
- Move the kvm_tdx assert to tdx.c. [Paolo]
- Fix the assertion, again. [Vipin, in spirit if not in reality]
- Add a patch to move TDX hardware setup to tdx.c.
v3:
- https://lore.kernel.org/all/[email protected]
- Add comments explaining the {READ,WRITE}_ONCE logic, and why it's safe to set the list outside of mmu_lock. [Vipin]
- Make the assertions actually work. [Vipin]
- Refine the assertions so they (hopefully) won't fail on kernels with a bunch of debug crud added.
v2:
- https://lore.kernel.org/all/[email protected]
- Actually defer allocation when using TDP MMU. [Vipin]
- Free allocation on MMU teardown. [Vipin]
v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (4):
KVM: TDX: Move TDX hardware setup from main.c to tdx.c
KVM: x86/mmu: Dynamically allocate shadow MMU's hashed page list
KVM: x86: Use kvzalloc() to allocate VM struct
KVM: x86/mmu: Defer allocation of shadow MMU's hashed page list
arch/x86/include/asm/kvm_host.h | 6 +-- arch/x86/kvm/mmu/mmu.c | 75 ++++++++++++++++++++++++++++++--- arch/x86/kvm/svm/svm.c | 2 + arch/x86/kvm/vmx/main.c | 36 +--------------- arch/x86/kvm/vmx/tdx.c | 47 +++++++++++++++------ arch/x86/kvm/vmx/tdx.h | 1 + arch/x86/kvm/vmx/vmx.c | 2 + arch/x86/kvm/vmx/x86_ops.h | 10 ----- arch/x86/kvm/x86.c | 5 ++- arch/x86/kvm/x86.h | 22 ++++++++++ 10 files changed, 139 insertions(+), 67 deletions(-)
base-commit: 3f7b307757ecffc1c18ede9ee3cf9ce8101f3cc9
Signature · 1 line
2.49.0.1151.ga128411c76-goog