Skip to content

KVM: x86/mmu: Make tdp_mmu read-only and clean up TPD MMU fault handler

David Matlack kvm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 17 repliesIn review
  2. v210 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- Use __ro_after_init for tdp_mmu_allowed [Kai]
- Use a macro instead of a const bool for 32-bit [Kai, Sean]
- Drop unnecessary whitespace change [Isaku]
- Make kvm_tdp_mmu_page_fault() static [Isaku]

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10KVM: x86/mmu: Change tdp_mmu to a read-only parameterarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.h arch/x86/kvm/mmu/mmu.c +1 more+39 -369 replies
2/10KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabledarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/tdp_mmu.c arch/x86/kvm/mmu/tdp_mmu.h+10 -141 reply
3/10KVM: x86/mmu: Grab mmu_invalidate_seq in kvm_faultin_pfn()arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h arch/x86/kvm/mmu/paging_tmpl.h+14 -141 reply
4/10KVM: x86/mmu: Handle error PFNs in kvm_faultin_pfn()arch/x86/kvm/mmu/mmu.c+11 -60 replies
5/10KVM: x86/mmu: Avoid memslot lookup during KVM_PFN_ERR_HWPOISON handlingarch/x86/kvm/mmu/mmu.c+9 -71 reply
6/10KVM: x86/mmu: Handle no-slot faults in kvm_faultin_pfn()arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/paging_tmpl.h+31 -310 replies
7/10KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUsarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h+6 -41 reply
8/10KVM: x86/mmu: Split out TDP MMU page fault handlingarch/x86/kvm/mmu/mmu.c+48 -142 replies
9/10KVM: x86/mmu: Stop needlessly making MMU pages available for TDP MMU faultsarch/x86/kvm/mmu/mmu.c+0 -41 reply
10/10KVM: x86/mmu: Rename __direct_map() to direct_map()arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/mmu_internal.h+8 -81 reply

Reviews trailers per patch

8 of 10 patches have a Reviewed-by or Acked-by.

PatchKai HuangIsaku Yamahata
1/10R-b
2/10R-b
3/10R-b
4/10
5/10R-b
6/10
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/10] KVM: x86/mmu: Make tdp_mmu read-only and clean up TPD MMU fault handler

This series changes the tdp_mmu module parameter to read-only so that the TDP MMU can be tracked in a global variable instead of per-VM state. Then it splits out a separate page fault handler for the TDP MMU and makes some clean ups along the way.

v3:
- Use __ro_after_init for tdp_mmu_allowed [Kai]
- Use a macro instead of a const bool for 32-bit [Kai, Sean]
- Drop unnecessary whitespace change [Isaku]
- Make kvm_tdp_mmu_page_fault() static [Isaku]

v2: https://lore.kernel.org/kvm/[email protected]/
- Make tdp_mmu read-only instead of deleting it entirely [Paolo]
- Fix 32-bit compilation failures [kernel test robot]

v1: https://lore.kernel.org/kvm/[email protected]/

Cc Kai Huang <[email protected]>
Cc Isaku Yamahata <[email protected]>
Cc Peter Xu <[email protected]>

David Matlack (10):
KVM: x86/mmu: Change tdp_mmu to a read-only parameter
KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabled
KVM: x86/mmu: Grab mmu_invalidate_seq in kvm_faultin_pfn()
KVM: x86/mmu: Handle error PFNs in kvm_faultin_pfn()
KVM: x86/mmu: Avoid memslot lookup during KVM_PFN_ERR_HWPOISON
handling
KVM: x86/mmu: Handle no-slot faults in kvm_faultin_pfn()
KVM: x86/mmu: Initialize fault.{gfn,slot} earlier for direct MMUs
KVM: x86/mmu: Split out TDP MMU page fault handling
KVM: x86/mmu: Stop needlessly making MMU pages available for TDP MMU
faults
KVM: x86/mmu: Rename __direct_map() to direct_map()

 arch/x86/include/asm/kvm_host.h |   9 --
 arch/x86/kvm/mmu.h              |   6 +-
 arch/x86/kvm/mmu/mmu.c          | 237 ++++++++++++++++++++------------
 arch/x86/kvm/mmu/mmu_internal.h |   8 +-
 arch/x86/kvm/mmu/paging_tmpl.h  |  12 +-
 arch/x86/kvm/mmu/tdp_mmu.c      |  11 --
 arch/x86/kvm/mmu/tdp_mmu.h      |   7 +-
 7 files changed, 164 insertions(+), 126 deletions(-)

base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2
prerequisite-patch-id: 2e3661ba8856c29b769499bac525b6943d9284b8

Signature · 1 line
2.37.3.998.g577e59143f-goog