]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Split kvm_pgtable_stage2_destroy()
authorRaghavendra Rao Ananta <rananta@google.com>
Wed, 20 Aug 2025 16:22:41 +0000 (16:22 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 21 Aug 2025 23:27:03 +0000 (16:27 -0700)
commit0e89ca13ee5ff41b437bb2a003c0eaf34ea43555
tree84700bc0305c31e1e9e47d4f2f9e636a21759e69
parentd19c541d269eddd9702b687fd4ba587c7da497a2
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 <oliver.upton@linux.dev>
Link: https://lore.kernel.org/r/20250820162242.2624752-2-rananta@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
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