OpenCloudOS-Kernel/virt/kvm/arm
Christoffer Dall 0d997491f8 arm/arm64: KVM: Fix disabled distributor operation
We currently do a single update of the vgic state when the distributor
enable/disable control register is accessed and then bypass updating the
state for as long as the distributor remains disabled.

This is incorrect, because updating the state does not consider the
distributor enable bit, and this you can end up in a situation where an
interrupt is marked as pending on the CPU interface, but not pending on
the distributor, which is an impossible state to be in, and triggers a
warning.  Consider for example the following sequence of events:

1. An interrupt is marked as pending on the distributor
   - the interrupt is also forwarded to the CPU interface
2. The guest turns off the distributor (it's about to do a reboot)
   - we stop updating the CPU interface state from now on
3. The guest disables the pending interrupt
   - we remove the pending state from the distributor, but don't touch
     the CPU interface, see point 2.

Since the distributor disable bit really means that no interrupts should
be forwarded to the CPU interface, we modify the code to keep updating
the internal VGIC state, but always set the CPU interface pending bits
to zero when the distributor is disabled.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
2015-10-20 18:09:13 +02:00
..
arch_timer.c arm/arm64: KVM: Fix arch timer behavior for disabled interrupts 2015-10-20 18:04:54 +02:00
vgic-v2-emul.c KVM: arm/arm64: rework MMIO abort handling to use KVM MMIO bus 2015-03-30 17:07:19 +01:00
vgic-v2.c KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR 2015-08-12 11:28:24 +01:00
vgic-v3-emul.c KVM: arm: vgic: Drop useless Group0 warning 2015-06-17 09:58:12 +01:00
vgic-v3.c arm/arm64: KVM: Remove 'config KVM_ARM_MAX_VCPUS' 2015-09-17 13:13:27 +01:00
vgic.c arm/arm64: KVM: Fix disabled distributor operation 2015-10-20 18:09:13 +02:00
vgic.h KVM: arm/arm64: rework MMIO abort handling to use KVM MMIO bus 2015-03-30 17:07:19 +01:00