KVM: arm64: Add "struct kvm_page_fault"
From: | Sean Christopherson <seanjc-AT-google.com> | |
To: | Marc Zyngier <maz-AT-kernel.org>, Oliver Upton <oliver.upton-AT-linux.dev> | |
Subject: | [RFC PATCH 00/16] KVM: arm64: Add "struct kvm_page_fault" | |
Date: | Thu, 21 Aug 2025 14:00:26 -0700 | |
Message-ID: | <20250821210042.3451147-1-seanjc@google.com> | |
Cc: | linux-arm-kernel-AT-lists.infradead.org, kvmarm-AT-lists.linux.dev, linux-kernel-AT-vger.kernel.org, Sean Christopherson <seanjc-AT-google.com>, James Houghton <jthoughton-AT-google.com> | |
Archive-link: | Article |
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/20250618042424.330664-1-jthou... 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 -- 2.51.0.261.g7ce5a0a67e-goog