All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/26] KVM/ARM: Add support for GICv4
@ 2017-10-27 14:28 ` Marc Zyngier
  0 siblings, 0 replies; 234+ messages in thread
From: Marc Zyngier @ 2017-10-27 14:28 UTC (permalink / raw)
  To: linux-arm-kernel, kvmarm, kvm, linux-kernel
  Cc: Christoffer Dall, Eric Auger, Shanker Donthineni, Mark Rutland,
	Shameerali Kolothum Thodi, Andre Przywara

This series implements full support for GICv4 in KVM, bringing direct
injection of MSIs to arm and arm64, assuming you have the right
hardware (which is quite unlikely).

To get an idea of the design, I'd recommend you start with commit
7954907bedaf as well as patch #26, which try to shed some light on the
approach that I've taken. And before that, please digest some of the
GICv3/GICv4 architecture documentation[1] (less than 800 pages!). Once
you feel reasonably insane, you'll be in the right mood to read the
code (no, I didn't bother changing the above, I already hit LWN/QotW
once).

Now that the low-level irqchip code has been merged, what we have here
is mostly the KVM-specific part. I've lifted two of Eric's patches
(having slightly changed one of them) as they form the base of this
series.

The stack has now been quite heavily bashed on a Huawei D05 box using
an Intel I350 Ethernet card and passing a VF into the guest, using
QEMU as the setup userspace (although this platform needs workarounds
that I've pushed out separately). It has also been *very lightly*
tested on an arm64 model, with a PCI virtio block device passed from
the host to a guest (using kvmtool and Jean-Philippe Brucker's
excellent VFIO support patches[2]).

I've pushed out a branch based on 4.14-rc6 containing the dependencies:

git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/gicv4-kvm

* From v4:
   - Fixed bug where a newly mapped VLPI could fire without having had
     its properties setup yet. Oops.
   - Changed the error code on attempt to save an ITS using VLPIs to
     -ACCES, and documented the new error code.
   - Dropped the patch trying to prevent a mix of GICv3 and GICv4
     CPUs. This is a broken configuration, and trying to detect it
     without making a mess is hard.
   - Added the patch disabling setting the doorbell affinity from
     userspace as part of this series
   - Rebased the series on 4.14-rc6, but it should apply just the
     same on something older

* From v3:
   - Lots of cleanups following Christoffer's review
   - Got rid of all of the irqchip code (well, merged it)
   - Picked the minimal set of patches from Eric to get this working
   - Prevent VM save if using GICv4
   - Rebased on top of 4.14-rc3

* From v2:
  - Lots of fixes all over the map (the doorbell code was amazingly
    wrong, both at the GICv4 level and in KVM)
  - KVM GICv4 enablement is now gated by a command-line option and
    defaults to off
  - Now properly deals with ordering of vITS creation
  - Some debugging features
  - More documentation so that I can forget what this is all about
  - Huawei D05 quirks

* From v1:
  - The bulk of the 30-something initial patches have seen countless
    bugs being fixed, and some key data structures have been subtly
    tweaked (or killed altogether). They are still quite similar to
    what I had in v1 though.
  - The whole KVM code is brand new and as I said above, only lightly
    tested.
  - Collected a bunch a R-bs from Thomas and Eric (many thanks, guys).

[1] https://static.docs.arm.com/ihi0069/c/IHI0069C_gic_architecture_specification.pdf
[2] http://www.spinics.net/lists/kvm/msg151823.html

Eric Auger (2):
  KVM: arm/arm64: register irq bypass consumer on ARM/ARM64
  KVM: arm/arm64: vgic: restructure kvm_vgic_(un)map_phys_irq

Marc Zyngier (24):
  irqchip/gic-v3-its: Setup VLPI properties at map time
  KVM: arm: Select ARM_GIC_V3 and ARM_GIC_V3_ITS
  KVM: arm/arm64: vgic: Move kvm_vgic_destroy call around
  KVM: arm/arm64: vITS: Add MSI translation helpers
  KVM: arm/arm64: vITS: Add a helper to update the affinity of an LPI
  KVM: arm/arm64: GICv4: Add property field and per-VM predicate
  KVM: arm/arm64: GICv4: Add init/teardown of the per-VM vPE irq domain
  KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq
    bypass
  KVM: arm/arm64: GICv4: Handle INT command applied to a VLPI
  KVM: arm/arm64: GICv4: Unmap VLPI when freeing an LPI
  KVM: arm/arm64: GICv4: Propagate affinity changes to the physical ITS
  KVM: arm/arm64: GICv4: Handle CLEAR applied to a VLPI
  KVM: arm/arm64: GICv4: Handle MOVALL applied to a vPE
  KVM: arm/arm64: GICv4: Propagate property updates to VLPIs
  KVM: arm/arm64: GICv4: Handle INVALL applied to a vPE
  KVM: arm/arm64: GICv4: Use pending_last as a scheduling hint
  KVM: arm/arm64: GICv4: Add doorbell interrupt handling
  KVM: arm/arm64: GICv4: Use the doorbell interrupt as an unblocking
    source
  KVM: arm/arm64: GICv4: Hook vPE scheduling into vgic flush/sync
  KVM: arm/arm64: GICv4: Enable virtual cpuif if VLPIs can be delivered
  KVM: arm/arm64: GICv4: Prevent a VM using GICv4 from being saved
  KVM: arm/arm64: GICv4: Prevent userspace from changing doorbell
    affinity
  KVM: arm/arm64: GICv4: Enable VLPI support
  KVM: arm/arm64: GICv4: Theory of operations

 Documentation/admin-guide/kernel-parameters.txt    |   4 +
 Documentation/virtual/kvm/devices/arm-vgic-its.txt |   2 +
 arch/arm/kvm/Kconfig                               |   5 +
 arch/arm/kvm/Makefile                              |   1 +
 arch/arm64/kvm/Kconfig                             |   3 +
 arch/arm64/kvm/Makefile                            |   1 +
 drivers/irqchip/irq-gic-v3-its.c                   |  19 +-
 include/kvm/arm_vgic.h                             |  41 ++-
 include/linux/irqchip/arm-gic-v4.h                 |   2 +
 virt/kvm/arm/arch_timer.c                          |  24 +-
 virt/kvm/arm/arm.c                                 |  48 ++-
 virt/kvm/arm/hyp/vgic-v3-sr.c                      |   9 +-
 virt/kvm/arm/vgic/vgic-init.c                      |   9 +
 virt/kvm/arm/vgic/vgic-its.c                       | 193 +++++++----
 virt/kvm/arm/vgic/vgic-mmio-v3.c                   |   5 +
 virt/kvm/arm/vgic/vgic-v3.c                        |  14 +
 virt/kvm/arm/vgic/vgic-v4.c                        | 365 +++++++++++++++++++++
 virt/kvm/arm/vgic/vgic.c                           |  67 +++-
 virt/kvm/arm/vgic/vgic.h                           |  10 +
 19 files changed, 710 insertions(+), 112 deletions(-)
 create mode 100644 virt/kvm/arm/vgic/vgic-v4.c

-- 
2.11.0

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

end of thread, other threads:[~2017-11-10  9:41 UTC | newest]

Thread overview: 234+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27 14:28 [PATCH v5 00/26] KVM/ARM: Add support for GICv4 Marc Zyngier
2017-10-27 14:28 ` Marc Zyngier
2017-10-27 14:28 ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 01/26] irqchip/gic-v3-its: Setup VLPI properties at map time Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-30  6:46   ` Christoffer Dall
2017-10-30  6:46     ` Christoffer Dall
2017-10-30  6:46     ` Christoffer Dall
2017-10-27 14:28 ` [PATCH v5 02/26] KVM: arm/arm64: register irq bypass consumer on ARM/ARM64 Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-30  6:47   ` Christoffer Dall
2017-10-30  6:47     ` Christoffer Dall
2017-10-30  6:47     ` Christoffer Dall
2017-10-27 14:28 ` [PATCH v5 03/26] KVM: arm/arm64: vgic: restructure kvm_vgic_(un)map_phys_irq Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 04/26] KVM: arm: Select ARM_GIC_V3 and ARM_GIC_V3_ITS Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 05/26] KVM: arm/arm64: vgic: Move kvm_vgic_destroy call around Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 06/26] KVM: arm/arm64: vITS: Add MSI translation helpers Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 20:34   ` Auger Eric
2017-11-07 20:34     ` Auger Eric
2017-11-07 20:34     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 07/26] KVM: arm/arm64: vITS: Add a helper to update the affinity of an LPI Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 13:44   ` Auger Eric
2017-11-07 13:44     ` Auger Eric
2017-11-07 13:44     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 08/26] KVM: arm/arm64: GICv4: Add property field and per-VM predicate Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 20:30   ` Auger Eric
2017-11-07 20:30     ` Auger Eric
2017-11-07 20:30     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 09/26] KVM: arm/arm64: GICv4: Add init/teardown of the per-VM vPE irq domain Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 13:08   ` Auger Eric
2017-11-07 13:08     ` Auger Eric
2017-11-07 13:08     ` Auger Eric
2017-11-10  8:20     ` Christoffer Dall
2017-11-10  8:20       ` Christoffer Dall
2017-11-10  8:20       ` Christoffer Dall
2017-11-10  8:55       ` Marc Zyngier
2017-11-10  8:55         ` Marc Zyngier
2017-11-10  8:55         ` Marc Zyngier
2017-11-07 13:09   ` Auger Eric
2017-11-07 13:09     ` Auger Eric
2017-11-07 13:09     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 10/26] KVM: arm/arm64: GICv4: Wire mapping/unmapping of VLPIs in VFIO irq bypass Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 13:06   ` Auger Eric
2017-11-07 13:06     ` Auger Eric
2017-11-07 13:06     ` Auger Eric
2017-11-07 14:42     ` Marc Zyngier
2017-11-07 14:42       ` Marc Zyngier
2017-11-07 14:42       ` Marc Zyngier
2017-11-07 15:59       ` Auger Eric
2017-11-07 15:59         ` Auger Eric
2017-11-07 15:59         ` Auger Eric
2017-11-08 11:30         ` Marc Zyngier
2017-11-08 11:30           ` Marc Zyngier
2017-11-08 11:30           ` Marc Zyngier
2017-11-10  8:28       ` Christoffer Dall
2017-11-10  8:28         ` Christoffer Dall
2017-11-10  8:28         ` Christoffer Dall
2017-11-10  9:05         ` Marc Zyngier
2017-11-10  9:05           ` Marc Zyngier
2017-11-10  9:05           ` Marc Zyngier
2017-11-10  9:41           ` Christoffer Dall
2017-11-10  9:41             ` Christoffer Dall
2017-11-10  9:41             ` Christoffer Dall
2017-10-27 14:28 ` [PATCH v5 11/26] KVM: arm/arm64: GICv4: Handle INT command applied to a VLPI Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 20:15   ` Auger Eric
2017-11-07 20:15     ` Auger Eric
2017-11-07 20:15     ` Auger Eric
2017-11-08 11:40     ` Marc Zyngier
2017-11-08 11:40       ` Marc Zyngier
2017-11-08 11:40       ` Marc Zyngier
2017-11-08 14:14       ` Auger Eric
2017-11-08 14:14         ` Auger Eric
2017-11-08 14:14         ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 12/26] KVM: arm/arm64: GICv4: Unmap VLPI when freeing an LPI Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 20:28   ` Auger Eric
2017-11-07 20:28     ` Auger Eric
2017-11-07 20:28     ` Auger Eric
2017-11-08 11:52     ` Marc Zyngier
2017-11-08 11:52       ` Marc Zyngier
2017-11-08 11:52       ` Marc Zyngier
2017-11-08 14:14       ` Auger Eric
2017-11-08 14:14         ` Auger Eric
2017-11-08 14:14         ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 13/26] KVM: arm/arm64: GICv4: Propagate affinity changes to the physical ITS Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:01   ` Auger Eric
2017-11-07 21:01     ` Auger Eric
2017-11-07 21:01     ` Auger Eric
2017-11-08 12:05     ` Marc Zyngier
2017-11-08 12:05       ` Marc Zyngier
2017-11-08 12:05       ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 14/26] KVM: arm/arm64: GICv4: Handle CLEAR applied to a VLPI Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:04   ` Auger Eric
2017-11-07 21:04     ` Auger Eric
2017-11-07 21:04     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 15/26] KVM: arm/arm64: GICv4: Handle MOVALL applied to a vPE Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:06   ` Auger Eric
2017-11-07 21:06     ` Auger Eric
2017-11-07 21:06     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 16/26] KVM: arm/arm64: GICv4: Propagate property updates to VLPIs Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:28   ` Auger Eric
2017-11-07 21:28     ` Auger Eric
2017-11-07 21:28     ` Auger Eric
2017-11-08 15:08     ` Marc Zyngier
2017-11-08 15:08       ` Marc Zyngier
2017-11-08 15:08       ` Marc Zyngier
2017-11-10  8:37       ` Christoffer Dall
2017-11-10  8:37         ` Christoffer Dall
2017-11-10  8:37         ` Christoffer Dall
2017-11-10  8:58         ` Marc Zyngier
2017-11-10  8:58           ` Marc Zyngier
2017-11-10  8:58           ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 17/26] KVM: arm/arm64: GICv4: Handle INVALL applied to a vPE Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:23   ` Auger Eric
2017-11-07 21:23     ` Auger Eric
2017-11-07 21:23     ` Auger Eric
2017-11-10  8:41     ` Christoffer Dall
2017-11-10  8:41       ` Christoffer Dall
2017-11-10  8:41       ` Christoffer Dall
2017-11-10  8:56       ` Marc Zyngier
2017-11-10  8:56         ` Marc Zyngier
2017-11-10  8:56         ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 18/26] KVM: arm/arm64: GICv4: Use pending_last as a scheduling hint Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:38   ` Auger Eric
2017-11-07 21:38     ` Auger Eric
2017-11-07 21:38     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 19/26] KVM: arm/arm64: GICv4: Add doorbell interrupt handling Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:43   ` Auger Eric
2017-11-07 21:43     ` Auger Eric
2017-11-07 21:43     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 20/26] KVM: arm/arm64: GICv4: Use the doorbell interrupt as an unblocking source Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:45   ` Auger Eric
2017-11-07 21:45     ` Auger Eric
2017-11-07 21:45     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 21/26] KVM: arm/arm64: GICv4: Hook vPE scheduling into vgic flush/sync Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 21:54   ` Auger Eric
2017-11-07 21:54     ` Auger Eric
2017-11-07 21:54     ` Auger Eric
2017-11-07 22:14     ` Auger Eric
2017-11-07 22:14       ` Auger Eric
2017-11-07 22:14       ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 22/26] KVM: arm/arm64: GICv4: Enable virtual cpuif if VLPIs can be delivered Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-08  8:46   ` Auger Eric
2017-11-08  8:46     ` Auger Eric
2017-11-08  8:46     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 23/26] KVM: arm/arm64: GICv4: Prevent a VM using GICv4 from being saved Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-07 15:24   ` Auger Eric
2017-11-07 15:24     ` Auger Eric
2017-11-07 15:24     ` Auger Eric
2017-11-07 15:38     ` Marc Zyngier
2017-11-07 15:38       ` Marc Zyngier
2017-11-07 15:38       ` Marc Zyngier
2017-11-07 16:12       ` Auger Eric
2017-11-07 16:12         ` Auger Eric
2017-11-07 16:12         ` Auger Eric
2017-11-07 16:34         ` Marc Zyngier
2017-11-07 16:34           ` Marc Zyngier
2017-11-07 16:34           ` Marc Zyngier
2017-11-07 22:24           ` Auger Eric
2017-11-07 22:24             ` Auger Eric
2017-11-07 22:24             ` Auger Eric
2017-11-08  9:35             ` Auger Eric
2017-11-08  9:35               ` Auger Eric
2017-11-08  9:35               ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 24/26] KVM: arm/arm64: GICv4: Prevent userspace from changing doorbell affinity Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-30  6:51   ` Christoffer Dall
2017-10-30  6:51     ` Christoffer Dall
2017-10-30  6:51     ` Christoffer Dall
2017-11-07 22:17   ` Auger Eric
2017-11-07 22:17     ` Auger Eric
2017-11-07 22:17     ` Auger Eric
2017-10-27 14:28 ` [PATCH v5 25/26] KVM: arm/arm64: GICv4: Enable VLPI support Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-08  8:44   ` Auger Eric
2017-11-08  8:44     ` Auger Eric
2017-11-08  8:44     ` Auger Eric
2017-11-08 15:14     ` Marc Zyngier
2017-11-08 15:14       ` Marc Zyngier
2017-11-08 15:14       ` Marc Zyngier
2017-10-27 14:28 ` [PATCH v5 26/26] KVM: arm/arm64: GICv4: Theory of operations Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-10-27 14:28   ` Marc Zyngier
2017-11-08  9:13   ` Auger Eric
2017-11-08  9:13     ` Auger Eric
2017-11-08  9:13     ` Auger Eric
2017-11-08 15:19     ` Marc Zyngier
2017-11-08 15:19       ` Marc Zyngier
2017-11-08 15:19       ` 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.