Skip to content

kvmtool: arm64: GICv3 guest support

Andre Przywara kvm kvmarm linux-arm-kernel 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest10 patches 0 repliesNew
  2. v410 patches 4 repliesSuperseded
  3. v310 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v28 patches8 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10AArch64: Reserve two 64k pages for GIC CPU interfacearm/aarch64/include/kvm/kvm-arch.h+1 -10 replies
2/10AArch{32, 64}: use KVM_CREATE_DEVICE & co to instanciate the GICarm/gic.c arm/include/arm-common/gic.h arm/kvm.c+66 -110 replies
3/10irq: add irq__get_nr_allocated_linesinclude/kvm/irq.h irq.c+6 -00 replies
4/10AArch{32, 64}: dynamically configure the number of GIC interruptsarm/gic.c+25 -00 replies
5/10arm: finish VGIC initialisation explicitlyarm/gic.c+22 -30 replies
6/10arm: simplify MMIO dispatchingarm/include/arm-common/kvm-arch.h arm/include/arm-common/kvm-cpu-arch.h arm/kvm-cpu.c+12 -300 replies
7/10limit number of VCPUs on demandarm/gic.c+0 -60 replies
8/10arm: prepare for instantiating different IRQ chip devicesarm/aarch32/arm-cpu.c arm/aarch64/arm-cpu.c arm/gic.c +2 more+44 -140 replies
9/10arm: add support for supplying GICv3 redistributor addressesarm/gic.c arm/include/arm-common/gic.h arm/include/arm-common/kvm-arch.h+43 -10 replies
10/10arm: use new irqchip parameter to create different vGIC typesarm/aarch64/arm-cpu.c arm/gic.c arm/include/arm-common/kvm-config-arch.h +1 more+26 -30 replies

Reviews trailers per patch

4 of 10 patches have a Reviewed-by or Acked-by.

PatchMarc Zyngier
1/10
2/10
3/10
4/10
5/10R-b
6/10R-b
7/10
8/10R-b
9/10R-b
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/10] kvmtool: arm64: GICv3 guest support

Hi,

only very minor changes (patch 7 and 10) compared to v4:
Any failure in instantiating a VCPU now makes kvmtool abort, so requesting more VCPUs than the selected kernel's VGIC emulation can handle will let the user know immediately ;-) Also I removed the unneeded initialization of the irqchip type to GICv2.
Will, can you apply this series?

Cheers,
Andre.

-----
Since Linux 3.19 the kernel can emulate a GICv3 for KVM guests. This allows more than 8 VCPUs in a guest and enables in-kernel irqchip for non-backwards-compatible GICv3 implementations.

This series updates kvmtool to support this feature.
The first half of the series is mostly from Marc and supports some newer features of the virtual GIC which we later depend on. The second part enables support for a guest GICv3 by adding a new command line parameter (--irqchip=).

We now use the KVM_CREATE_DEVICE interface to create a virtual GIC and only fall back to the now legacy KVM_CREATE_IRQCHIP call if the former is not supported by the kernel.
Also we use two new features the KVM_CREATE_DEVICE interface introduces:
* We now set the number of actually used interrupts to avoid allocating too many of them without ever using them.
* We tell the kernel explicitly that we are finished with the GIC initialisation. This is a requirement for future VGIC versions.

The final three patches introduce virtual GICv3 support, so on supported hardware (and given kernel support) the user can ask KVM to emulate a GICv3, lifting the 8 VCPU limit of KVM. This is done by specifying "--irqchip=gicv3" on the command line.
For the time being the kernel only supports a virtual GICv3 on ARM64, but as the GIC is shared in kvmtool, I had to add the macro definitions to not break the build on ARM.

This series goes on top of the new official stand-alone repo hosted on Will's kernel.org git [1].
Find a branch with those patches included at my repo [2].

[1] git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git
[2] git://linux-arm.org/kvmtool.git (branch gicv3/v5)

    http://www.linux-arm.org/git?p=kvmtool.git;a=log;h=refs/heads/gicv3/v5

Andre Przywara (6):
arm: finish VGIC initialisation explicitly
arm: simplify MMIO dispatching
limit number of VCPUs on demand
arm: prepare for instantiating different IRQ chip devices
arm: add support for supplying GICv3 redistributor addresses
arm: use new irqchip parameter to create different vGIC types

Marc Zyngier (4):
AArch64: Reserve two 64k pages for GIC CPU interface AArch{32,64}: use KVM_CREATE_DEVICE & co to instanciate the GIC
irq: add irq__get_nr_allocated_lines
AArch{32,64}: dynamically configure the number of GIC interrupts

 arm/aarch32/arm-cpu.c                    |   2 +-
 arm/aarch64/arm-cpu.c                    |   2 +-
 arm/aarch64/include/kvm/kvm-arch.h       |   2 +-
 arm/gic.c                                | 189 +++++++++++++++++++++++++++++--
 arm/include/arm-common/gic.h             |   9 +-
 arm/include/arm-common/kvm-arch.h        |  19 ++--
 arm/include/arm-common/kvm-config-arch.h |   9 +-
 arm/include/arm-common/kvm-cpu-arch.h    |  14 ++-
 arm/kvm-cpu.c                            |  16 ---
 arm/kvm.c                                |   6 +-
 include/kvm/irq.h                        |   1 +
 irq.c                                    |   5 +
 12 files changed, 225 insertions(+), 49 deletions(-)
Signature · 1 line
2.3.5