1
0
Fork 0
remarkable-linux/include/linux/irqchip
Marc Zyngier e693f1331c KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid
commit 16ca6a607d upstream.

The vgic code is trying to be clever when injecting GICv2 SGIs,
and will happily populate LRs with the same interrupt number if
they come from multiple vcpus (after all, they are distinct
interrupt sources).

Unfortunately, this is against the letter of the architecture,
and the GICv2 architecture spec says "Each valid interrupt stored
in the List registers must have a unique VirtualID for that
virtual CPU interface.". GICv3 has similar (although slightly
ambiguous) restrictions.

This results in guests locking up when using GICv2-on-GICv3, for
example. The obvious fix is to stop trying so hard, and inject
a single vcpu per SGI per guest entry. After all, pending SGIs
with multiple source vcpus are pretty rare, and are mostly seen
in scenario where the physical CPUs are severely overcomitted.

But as we now only inject a single instance of a multi-source SGI per
vcpu entry, we may delay those interrupts for longer than strictly
necessary, and run the risk of injecting lower priority interrupts
in the meantime.

In order to address this, we adopt a three stage strategy:
- If we encounter a multi-source SGI in the AP list while computing
  its depth, we force the list to be sorted
- When populating the LRs, we prevent the injection of any interrupt
  of lower priority than that of the first multi-source SGI we've
  injected.
- Finally, the injection of a multi-source SGI triggers the request
  of a maintenance interrupt when there will be no pending interrupt
  in the LRs (HCR_NPIE).

At the point where the last pending interrupt in the LRs switches
from Pending to Active, the maintenance interrupt will be delivered,
allowing us to add the remaining SGIs using the same process.

Cc: stable@vger.kernel.org
Fixes: 0919e84c0f ("KVM: arm/arm64: vgic-new: Add IRQ sync/flush framework")
Acked-by: Christoffer Dall <cdall@kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-21 12:06:43 +01:00
..
arm-gic-common.h irqchip/gic-v3: Advertise GICv4 support to KVM 2017-08-31 15:31:42 +01:00
arm-gic-v3.h KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid 2018-03-21 12:06:43 +01:00
arm-gic-v4.h irqchip/gic-v4: Enable low-level GICv4 operations 2017-08-31 15:31:42 +01:00
arm-gic.h KVM: arm/arm64: vgic: Don't populate multiple LRs with the same vintid 2018-03-21 12:06:43 +01:00
arm-vic.h irqchip: support cascaded VICs 2014-02-13 11:21:21 +01:00
chained_irq.h arm: Move chained_irq_(enter|exit) to a generic file 2013-03-26 16:11:43 +00:00
ingenic.h MIPS/IRQCHIP: Move Ingenic SoC intc driver to drivers/irqchip 2015-06-21 21:53:10 +02:00
irq-omap-intc.h irqchip: omap-intc: Remove unused legacy interface for omap2 2015-01-26 11:38:23 +01:00
irq-partition-percpu.h irqchip: Add per-cpu interrupt partitioning library 2016-05-02 13:42:51 +02:00
irq-sa11x0.h ARM: 8367/1: sa1100: prepare for moving irq driver to drivers/irqchip 2015-05-28 14:40:03 +01:00
metag-ext.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
metag.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mxs.h ARM: mxs: move icoll driver into drivers/irqchip 2013-04-01 16:30:04 +08:00
versatile-fpga.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xtensa-mx.h xtensa: add MX irqchip 2014-01-14 10:19:58 -08:00
xtensa-pic.h xtensa: move built-in PIC to drivers/irqchip 2014-01-14 10:19:56 -08:00