linux/virt/kvm/arm/vgic
Christoffer Dall 35a2d58588 KVM: arm/arm64: vgic-new: Synchronize changes to active state
When modifying the active state of an interrupt via the MMIO interface,
we should ensure that the write has the intended effect.

If a guest sets an interrupt to active, but that interrupt is already
flushed into a list register on a running VCPU, then that VCPU will
write the active state back into the struct vgic_irq upon returning from
the guest and syncing its state.  This is a non-benign race, because the
guest can observe that an interrupt is not active, and it can have a
reasonable expectations that other VCPUs will not ack any IRQs, and then
set the state to active, and expect it to stay that way.  Currently we
are not honoring this case.

Thefore, change both the SACTIVE and CACTIVE mmio handlers to stop the
world, change the irq state, potentially queue the irq if we're setting
it to active, and then continue.

We take this chance to slightly optimize these functions by not stopping
the world when touching private interrupts where there is inherently no
possible race.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2016-05-20 16:26:38 +02:00
..
vgic-init.c KVM: arm/arm64: vgic-new: vgic_init: implement map_resources 2016-05-20 15:40:07 +02:00
vgic-irqfd.c KVM: arm/arm64: vgic-new: Wire up irqfd injection 2016-05-20 15:40:08 +02:00
vgic-kvm-device.c KVM: arm/arm64: vgic-new: Add userland GIC CPU interface access 2016-05-20 15:40:05 +02:00
vgic-mmio-v2.c KVM: arm/arm64: vgic-new: Add userland GIC CPU interface access 2016-05-20 15:40:05 +02:00
vgic-mmio-v3.c KVM: arm/arm64: vgic-new: Add GICv3 SGI system register trap handler 2016-05-20 15:39:59 +02:00
vgic-mmio.c KVM: arm/arm64: vgic-new: Synchronize changes to active state 2016-05-20 16:26:38 +02:00
vgic-mmio.h KVM: arm/arm64: vgic-new: Add GICv3 MMIO handling framework 2016-05-20 15:39:56 +02:00
vgic-v2.c KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable 2016-05-20 15:40:07 +02:00
vgic-v3.c KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable 2016-05-20 15:40:07 +02:00
vgic.c KVM: arm/arm64: vgic-new: implement mapped IRQ handling 2016-05-20 15:40:09 +02:00
vgic.h KVM: arm/arm64: vgic-new: vgic_init: implement map_resources 2016-05-20 15:40:07 +02:00