linux-stable/arch/arm64/kvm/vgic
Marc Zyngier 3134cc8beb KVM: arm64: vgic: Resample HW pending state on deactivation
When a mapped level interrupt (a timer, for example) is deactivated
by the guest, the corresponding host interrupt is equally deactivated.
However, the fate of the pending state still needs to be dealt
with in SW.

This is specially true when the interrupt was in the active+pending
state in the virtual distributor at the point where the guest
was entered. On exit, the pending state is potentially stale
(the guest may have put the interrupt in a non-pending state).

If we don't do anything, the interrupt will be spuriously injected
in the guest. Although this shouldn't have any ill effect (spurious
interrupts are always possible), we can improve the emulation by
detecting the deactivation-while-pending case and resample the
interrupt.

While we're at it, move the logic into a common helper that can
be shared between the two GIC implementations.

Fixes: e40cc57bac ("KVM: arm/arm64: vgic: Support level-triggered mapped interrupts")
Reported-by: Raghavendra Rao Ananta <rananta@google.com>
Tested-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210819180305.1670525-1-maz@kernel.org
2021-08-20 08:53:22 +01:00
..
trace.h
vgic-debug.c KVM: arm64: vgic-debug: Convert to use DEFINE_SEQ_ATTRIBUTE macro 2020-09-18 16:17:27 +01:00
vgic-init.c KVM: arm64: vgic: Let an interrupt controller advertise lack of HW deactivation 2021-06-01 10:45:59 +01:00
vgic-irqfd.c KVM: arm64: Allow in-atomic injection of SPIs 2020-07-05 17:26:15 +01:00
vgic-its.c ARM: 2021-05-01 10:14:08 -07:00
vgic-kvm-device.c KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read 2021-04-13 15:04:50 +01:00
vgic-mmio-v2.c KVM: arm64: Fix comments related to GICv2 PMR reporting 2021-08-02 14:49:39 +01:00
vgic-mmio-v3.c ARM: 2021-05-01 10:14:08 -07:00
vgic-mmio.c KVM: arm64: Simplify argument passing to vgic_uaccess_[read|write] 2021-04-06 14:51:38 +01:00
vgic-mmio.h
vgic-v2.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic-v3.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic-v4.c KVM: arm64: GICv4.1: Restore VLPI pending state to physical side 2021-03-24 18:12:21 +00:00
vgic.c KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00
vgic.h KVM: arm64: vgic: Resample HW pending state on deactivation 2021-08-20 08:53:22 +01:00