Skip to content

RFC KVM: arm64: Add "struct kvm_page_fault"

Sean Christopherson kvmarm linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest16 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16KVM: arm64: Drop nested "esr" to eliminate variable shadowingarch/arm64/kvm/mmu.c+2 -60 replies
2/16KVM: arm64: Get iabt status on-demandarch/arm64/kvm/mmu.c+4 -50 replies
3/16KVM: arm64: Move SRCU-protected region of kvm_handle_guest_abort() to helperarch/arm64/kvm/mmu.c+88 -840 replies
4/16KVM: arm64: Use guard(srcu) in kvm_handle_guest_abort()arch/arm64/kvm/mmu.c+2 -60 replies
5/16KVM: arm64: Introduce "struct kvm_page_fault" for tracking abort statearch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c+87 -744 replies
6/16KVM: arm64: Pass kvm_page_fault pointer to transparent_hugepage_adjust()arch/arm64/kvm/mmu.c+6 -140 replies
7/16KVM: arm64: Pass @fault to fault_supports_stage2_huge_mapping()arch/arm64/kvm/mmu.c+7 -70 replies
8/16KVM: arm64: Add helper to get permission fault granule from ESRarch/arm64/include/asm/esr.h arch/arm64/include/asm/kvm_emulate.h+7 -10 replies
9/16KVM: arm64: Track perm fault granule in "struct kvm_page_fault"arch/arm64/include/asm/kvm_emulate.h arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c+7 -160 replies
10/16KVM: arm64: Drop local vfio_allow_any_uc, use vm_flags snapshotarch/arm64/kvm/mmu.c+2 -40 replies
11/16KVM: arm64: Drop local mte_allowed, use vm_flags snapshotarch/arm64/kvm/mmu.c+3 -90 replies
12/16KVM: arm64: Move VMA-related information into "struct kvm_page_fault"arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c+41 -350 replies
13/16KVM: arm64: Stash "mmu_seq" in "struct kvm_page_fault"arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c+3 -30 replies
14/16KVM: arm64: Track "forced" information in "struct kvm_page_fault"arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/mmu.c+14 -110 replies
15/16KVM: arm64: Extract mmap_lock-protected code to helper for user mem abortsarch/arm64/kvm/mmu.c+52 -440 replies
16/16KVM: arm64: Don't bother nullifying "vma" in mem abort patharch/arm64/kvm/mmu.c+0 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/16] KVM: arm64: Add "struct kvm_page_fault"

Add an arm64 version of "struct kvm_page_fault" to (hopefully) tidy up the abort path, and to pave the way for things like KVM Userfault[*] that want to consume kvm_page_fault in arch-neutral code.

This is essentially one giant nop of code shuffling.

RFC as this is only compile-tested. I didn't want to spend time testing until I got feedback on whether or not y'all are amenable to the general idea.

[*] https://lore.kernel.org/all/[email protected]

Sean Christopherson (16):
KVM: arm64: Drop nested "esr" to eliminate variable shadowing
KVM: arm64: Get iabt status on-demand
KVM: arm64: Move SRCU-protected region of kvm_handle_guest_abort() to
helper
KVM: arm64: Use guard(srcu) in kvm_handle_guest_abort()
KVM: arm64: Introduce "struct kvm_page_fault" for tracking abort state
KVM: arm64: Pass kvm_page_fault pointer to
transparent_hugepage_adjust()
KVM: arm64: Pass @fault to fault_supports_stage2_huge_mapping()
KVM: arm64: Add helper to get permission fault granule from ESR
KVM: arm64: Track perm fault granule in "struct kvm_page_fault"
KVM: arm64: Drop local vfio_allow_any_uc, use vm_flags snapshot
KVM: arm64: Drop local mte_allowed, use vm_flags snapshot
KVM: arm64: Move VMA-related information into "struct kvm_page_fault"
KVM: arm64: Stash "mmu_seq" in "struct kvm_page_fault"
KVM: arm64: Track "forced" information in "struct kvm_page_fault"
KVM: arm64: Extract mmap_lock-protected code to helper for user mem
aborts
KVM: arm64: Don't bother nullifying "vma" in mem abort path

 arch/arm64/include/asm/esr.h         |   6 +
 arch/arm64/include/asm/kvm_emulate.h |   9 -
 arch/arm64/include/asm/kvm_host.h    |  32 ++
 arch/arm64/kvm/mmu.c                 | 514 +++++++++++++--------------
 4 files changed, 282 insertions(+), 279 deletions(-)

base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585

Signature · 1 line
2.51.0.261.g7ce5a0a67e-goog