]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Prevent teardown finalisation of referenced 'hyp_vm'
authorWill Deacon <will@kernel.org>
Tue, 31 Mar 2026 15:50:53 +0000 (16:50 +0100)
committerMarc Zyngier <maz@kernel.org>
Wed, 1 Apr 2026 13:29:06 +0000 (14:29 +0100)
commit760299a1d8102b36bed5c25c5a3f94b5a0eee081
tree08fa708722ca6b7b27e6721f98cd41dbf887f17d
parent61135967fa76d37883d90ccccc5a1cb73e90b94d
KVM: arm64: Prevent teardown finalisation of referenced 'hyp_vm'

Destroying a 'hyp_vm' with an elevated referenced count in
__pkvm_finalize_teardown_vm() is only going to lead to tears.

In preparation for allowing limited references to be acquired on dying
VMs during the teardown process, factor out the handle-to-vm logic for
the teardown path and reuse it for both the 'start' and 'finalise'
stages of the teardown process.

Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260331155056.28220-2-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/pkvm.c