]> 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)
committerOliver Upton <oliver.upton@linux.dev>
Tue, 12 Dec 2023 07:11:38 +0000 (07:11 +0000)
commit02e3858f08faabab9503ae2911cf7c7e27702257
treef314b7f0b0b0785531c9ed54cdd3f59b7b7bb4e7
parentd26b9cb33c2d1ba68d1f26bb06c40300f16a3799
KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy

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>
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