lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1403688530-23273-1-git-send-email-marc.zyngier@arm.com>
Date:	Wed, 25 Jun 2014 10:28:41 +0100
From:	Marc Zyngier <marc.zyngier@....com>
To:	kvmarm@...ts.cs.columbia.edu, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Cc:	Will Deacon <will.deacon@....com>,
	Catalin Marinas <catalin.marinas@....com>,
	Thomas Gleixner <tglx@...utronix.de>, eric.auger@...aro.org,
	Christoffer Dall <christoffer.dall@...aro.org>
Subject: [RFC PATCH 0/9] ARM: Forwarding physical interrupts to a guest VM

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ