]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Split kvm_pgtable_stage2_destroy()
authorRaghavendra Rao Ananta <rananta@google.com>
Thu, 13 Nov 2025 05:24:51 +0000 (05:24 +0000)
committerOliver Upton <oupton@kernel.org>
Wed, 19 Nov 2025 22:11:57 +0000 (14:11 -0800)
commitd68d66e57e2be9541fa67bafabdfe8826bb73799
tree5051c5701d4cbd5dbead525875d90c793dbb8353
parent156f70afcfecfc45be5fdc2e4adebc5ea70a93b0
KVM: arm64: Split kvm_pgtable_stage2_destroy()

Split kvm_pgtable_stage2_destroy() into two:
  - kvm_pgtable_stage2_destroy_range(), that performs the
    page-table walk and free the entries over a range of addresses.
  - kvm_pgtable_stage2_destroy_pgd(), that frees the PGD.

This refactoring enables subsequent patches to free large page-tables
in chunks, calling cond_resched() between each chunk, to yield the
CPU as necessary.

Existing callers of kvm_pgtable_stage2_destroy(), that probably cannot
take advantage of this (such as nVMHE), will continue to function as is.

Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Suggested-by: Oliver Upton <oupton@kernel.org>
Link: https://msgid.link/20251113052452.975081-3-rananta@google.com
Signed-off-by: Oliver Upton <oupton@kernel.org>
arch/arm64/include/asm/kvm_pgtable.h
arch/arm64/include/asm/kvm_pkvm.h
arch/arm64/kvm/hyp/pgtable.c
arch/arm64/kvm/mmu.c
arch/arm64/kvm/pkvm.c