]> 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>
Fri, 5 Jan 2024 14:13:35 +0000 (15:13 +0100)
commitccda72aa73c791d51559acc95e1104a613d8dadd
tree5a3deca3a1d694a433342b4e69b3f931c5438fb9
parent46bc250b082c75754804ce821d6467daab09c099
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