KVM: arm64: Add a helper to tear down unlinked stage-2 subtrees
authorOliver Upton <oliver.upton@linux.dev>
Mon, 7 Nov 2022 21:56:35 +0000 (21:56 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 14:43:46 +0000 (14:43 +0000)
commit8e94e1252cc054bb31fd3e9a15235cd831970ec1
tree6c014757ce57ce0ff55786d83d8820388d15be4f
parentfa002e8e79b3f980455ba585c1f47b26680de5b9
KVM: arm64: Add a helper to tear down unlinked stage-2 subtrees

A subsequent change to KVM will move the tear down of an unlinked
stage-2 subtree out of the critical path of the break-before-make
sequence.

Introduce a new helper for tearing down unlinked stage-2 subtrees.
Leverage the existing stage-2 free walkers to do so, with a deep call
into __kvm_pgtable_walk() as the subtree is no longer reachable from the
root.

Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221107215644.1895162-6-oliver.upton@linux.dev
arch/arm64/include/asm/kvm_pgtable.h
arch/arm64/kvm/hyp/pgtable.c