All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/9] ARM: Forwarding physical interrupts to a guest VM
@ 2014-06-25  9:28 ` Marc Zyngier
  0 siblings, 0 replies; 84+ messages in thread
From: Marc Zyngier @ 2014-06-25  9:28 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel, linux-kernel
  Cc: Will Deacon, Catalin Marinas, Thomas Gleixner, eric.auger,
	Christoffer Dall

The GIC architecture (ARM's Generic Interrupt Controller) allows an
active physical interrupt to be forwarded to a guest, and the guest to
indirectly perform the deactivation of the interrupt by performing an
EOI on the virtual interrupt (see for example the GICv2 spec, 3.2.1).

So far, Linux doesn't have this notion, which is a bit of a pain.

This patch series introduce two generic features:

- A way to mark an interrupt as "forwarded": this allows an irq_chip
  to know that it shouldn't perform the deactivation itself
- A way to save/restore the "state" of a "forwarded" interrupt

The series then adapts both GIC drivers to switch to EOImode == 1
(split priority drop and deactivation), to support this "forwarded"
feature and hacks the KVM/ARM timer backend to use all of this.

This requires yet another bit of surgery in the vgic code in order to
allow a mapping between physical interrupts and virtual
ones. Hopefully, this should plug into VFIO and the whole irqfd thing,
but I don't understand any of that just yet (Eric?)

The patches are against 3.16-rc2, plus a massive amount of GICv3
code. They are also available in my git repo:
git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/irq-forward

Open questions (Thomas, these are mostly targeted at you):

- Are the generic features generic enough?
- Would the "forwarded" thing be better implemented as a handler
  rather than an irq_chip specific thing?
- The split priority drop/deactivate also fits the threaded interrupt
  model fairly well (no need to mask/unmask). Should we have a go at
  this too?
- Does it fit the VFIO+KVM model without playing the ugly mask/unmask
  dance?

Thanks,

	M.

Marc Zyngier (9):
  genirq: Add IRQD_IRQ_FORWARDED flag and accessors
  genirq: Allow the state of a  forwarded irq to be save/restored
  irqchip: GIC: Convert to EOImode == 1
  irqchip: GIC: add support for forwarded interrupts
  irqchip: GICv3: Convert to EOImode == 1
  irqchip: GICv3: add support for forwarded interrupts
  KVM: arm: vgic: allow dynamic mapping of physical/virtual interrupts
  arm: KVM: timer: move the timer switch into the non-preemptible
    section
  KVM: arm: timer: make the interrupt state part of the timer state

 arch/arm/kvm/arm.c                 |   7 +--
 drivers/irqchip/irq-gic-v3-its.c   |   2 +
 drivers/irqchip/irq-gic-v3.c       |  33 +++++++++++-
 drivers/irqchip/irq-gic.c          | 107 +++++++++++++++++++++++++++++++++----
 include/kvm/arm_arch_timer.h       |   3 ++
 include/kvm/arm_vgic.h             |  13 +++++
 include/linux/interrupt.h          |   2 +
 include/linux/irq.h                |  32 +++++++++++
 include/linux/irqchip/arm-gic-v3.h |  12 +++++
 include/linux/irqchip/arm-gic.h    |   5 ++
 kernel/irq/manage.c                |  80 +++++++++++++++++++++++++++
 virt/kvm/arm/arch_timer.c          |  31 ++++++++++-
 virt/kvm/arm/vgic-v2.c             |  14 ++++-
 virt/kvm/arm/vgic-v3.c             |  22 +++++++-
 virt/kvm/arm/vgic.c                |  88 ++++++++++++++++++++++++++++++
 15 files changed, 431 insertions(+), 20 deletions(-)

-- 
1.8.3.4


^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2014-08-11 13:22 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  9:28 [RFC PATCH 0/9] ARM: Forwarding physical interrupts to a guest VM Marc Zyngier
2014-06-25  9:28 ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 1/9] genirq: Add IRQD_IRQ_FORWARDED flag and accessors Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 2/9] genirq: Allow the state of a forwarded irq to be save/restored Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-27 13:10   ` Will Deacon
2014-06-27 13:10     ` Will Deacon
2014-07-07  8:40     ` Marc Zyngier
2014-07-07  8:40       ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 3/9] irqchip: GIC: Convert to EOImode == 1 Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25 12:50   ` Rob Herring
2014-06-25 12:50     ` Rob Herring
2014-06-25 13:03     ` Marc Zyngier
2014-06-25 13:03       ` Marc Zyngier
2014-06-25 13:18       ` Rob Herring
2014-06-25 13:18         ` Rob Herring
2014-06-25 13:56   ` Anup Patel
2014-06-25 13:56     ` Anup Patel
2014-06-25 14:03     ` Ian Campbell
2014-06-25 14:03       ` Ian Campbell
2014-06-25 14:31       ` Marc Zyngier
2014-06-25 14:31         ` Marc Zyngier
2014-06-25 14:08     ` Rob Herring
2014-06-25 14:08       ` Rob Herring
2014-06-25 14:24     ` Marc Zyngier
2014-06-25 14:24       ` Marc Zyngier
2014-06-25 14:27       ` Ian Campbell
2014-06-25 14:27         ` Ian Campbell
2014-06-25 20:14     ` Joel Schopp
2014-06-25 20:14       ` Joel Schopp
2014-06-30 19:09     ` Stefano Stabellini
2014-06-30 19:09       ` Stefano Stabellini
2014-07-01  8:24       ` Marc Zyngier
2014-07-01  8:24         ` Marc Zyngier
2014-07-01 16:34         ` Stefano Stabellini
2014-07-01 16:34           ` Stefano Stabellini
2014-07-01 16:42           ` Marc Zyngier
2014-07-01 16:42             ` Marc Zyngier
2014-06-25 14:06   ` Peter Maydell
2014-06-25 14:06     ` Peter Maydell
2014-06-25 14:46     ` Marc Zyngier
2014-06-25 14:46       ` Marc Zyngier
2014-08-06 11:30     ` Christoffer Dall
2014-08-06 11:30       ` Christoffer Dall
2014-07-25 12:42   ` Eric Auger
2014-07-25 12:42     ` Eric Auger
2014-06-25  9:28 ` [RFC PATCH 4/9] irqchip: GIC: add support for forwarded interrupts Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-27 13:17   ` Will Deacon
2014-06-27 13:17     ` Will Deacon
2014-07-07 10:43     ` Marc Zyngier
2014-07-07 10:43       ` Marc Zyngier
2014-08-06 11:30   ` Christoffer Dall
2014-08-06 11:30     ` Christoffer Dall
2014-06-25  9:28 ` [RFC PATCH 5/9] irqchip: GICv3: Convert to EOImode == 1 Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 6/9] irqchip: GICv3: add support for forwarded interrupts Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 7/9] KVM: arm: vgic: allow dynamic mapping of physical/virtual interrupts Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-08-03  9:48   ` Eric Auger
2014-08-03  9:48     ` Eric Auger
2014-08-04 13:13     ` Marc Zyngier
2014-08-04 13:13       ` Marc Zyngier
2014-08-07 15:47       ` Eric Auger
2014-08-07 15:47         ` Eric Auger
2014-08-11  8:01         ` Christoffer Dall
2014-08-11  8:01           ` Christoffer Dall
2014-08-11 13:22           ` Eric Auger
2014-08-11 13:22             ` Eric Auger
2014-06-25  9:28 ` [RFC PATCH 8/9] arm: KVM: timer: move the timer switch into the non-preemptible section Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25  9:28 ` [RFC PATCH 9/9] KVM: arm: timer: make the interrupt state part of the timer state Marc Zyngier
2014-06-25  9:28   ` Marc Zyngier
2014-06-25 14:52 ` [RFC PATCH 0/9] ARM: Forwarding physical interrupts to a guest VM Eric Auger
2014-06-25 14:52   ` Eric Auger
2014-06-26  9:31   ` Marc Zyngier
2014-06-26  9:31     ` Marc Zyngier
2014-06-26 12:58     ` Eric Auger
2014-06-26 12:58       ` Eric Auger
2014-06-26 14:12       ` Marc Zyngier
2014-06-26 14:12         ` Marc Zyngier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.