]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: vgic: Simplify kvm_vgic_destroy()
authorMarc Zyngier <maz@kernel.org>
Thu, 7 Dec 2023 15:11:57 +0000 (15:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:39:08 +0000 (12:39 +0000)
commit3a0fd93cd9f7f267d69d9cc797f0a07870012865
tree1ecda768a2e9524991cb329e3380f63a5f083a65
parent3339028dd082a789f9010f49708026950349eca1
KVM: arm64: vgic: Simplify kvm_vgic_destroy()

commit 01ad29d224ff73bc4e16e0ef9ece17f28598c4a4 upstream.

When destroying a vgic, we have rather cumbersome rules about
when slots_lock and config_lock are held, resulting in fun
buglets.

The first port of call is to simplify kvm_vgic_map_resources()
so that there is only one call to kvm_vgic_destroy() instead of
two, with the second only holding half of the locks.

For that, we kill the non-locking primitive and move the call
outside of the locking altogether. This doesn't change anything
(we re-acquire the locks and teardown the whole vgic), and
simplifies the code significantly.

Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231207151201.3028710-2-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kvm/vgic/vgic-init.c