1
0
Fork 0
remarkable-linux/virt/kvm/arm/vgic
Christoffer Dall f3662e3325 KVM: arm/arm64: Fix vgic init race
[ Upstream commit 1d47191de7 ]

The vgic_init function can race with kvm_arch_vcpu_create() which does
not hold kvm_lock() and we therefore have no synchronization primitives
to ensure we're doing the right thing.

As the user is trying to initialize or run the VM while at the same time
creating more VCPUs, we just have to refuse to initialize the VGIC in
this case rather than silently failing with a broken VCPU.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26 08:38:04 +02:00
..
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vgic-debug.c KVM: arm/arm64: vgic: constify seq_operations and file_operations 2017-09-05 17:33:38 +02:00
vgic-init.c KVM: arm/arm64: Fix vgic init race 2018-09-26 08:38:04 +02:00
vgic-irqfd.c KVM: arm/arm64: vgic-irqfd: Fix MSI entry allocation 2017-12-14 09:53:01 +01:00
vgic-its.c KVM: arm/arm64: VGIC/ITS: protect kvm_read_guest() calls with SRCU lock 2018-05-22 18:53:57 +02:00
vgic-kvm-device.c KVM: arm/arm64: Register iodevs when setting redist base and creating VCPUs 2017-05-09 12:19:36 +02:00
vgic-mmio-v2.c KVM: arm/arm64: vgic: Fix possible spectre-v1 write in vgic_mmio_write_apr() 2018-09-26 08:38:02 +02:00
vgic-mmio-v3.c KVM: arm/arm64: vgic: Use READ_ONCE fo cmpxchg 2017-08-03 15:47:36 +01:00
vgic-mmio.c KVM: arm/arm64: vgic: Add missing irq_lock to vgic_mmio_read_pending 2018-05-30 07:52:15 +02:00
vgic-mmio.h KVM: arm/arm64: Separate guest and uaccess writes to dist {sc}active 2017-05-23 12:48:11 +02:00
vgic-v2.c KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid 2018-03-21 12:06:43 +01:00
vgic-v3.c KVM: arm/arm64: Drop resource size check for GICV window 2018-08-24 13:09:03 +02:00
vgic.c KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid 2018-03-21 12:06:43 +01:00
vgic.h KVM: arm/arm64: vgic: Add missing irq_lock to vgic_mmio_read_pending 2018-05-30 07:52:15 +02:00