]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy
authorMarc Zyngier <maz@kernel.org>
Thu, 7 Dec 2023 15:11:59 +0000 (15:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:39:08 +0000 (12:39 +0000)
commit425379154b7fd1e8f6005235ce35d8d268b52d46
treee3f0acb06f2beb53a43a7e40e0254994a38ff289
parent5dfacfd0fcd6fbd41c01ed981d289f036305231a
KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy

commit 02e3858f08faabab9503ae2911cf7c7e27702257 upstream.

When failing to create a vcpu because (for example) it has a
duplicate vcpu_id, we destroy the vcpu. Amusingly, this leaves
the redistributor registered with the KVM_MMIO bus.

This is no good, and we should properly clean the mess. Force
a teardown of the vgic vcpu interface, including the RD device
before returning to the caller.

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