Skip to content

KVM: ARM: Enable vtimers with user space gic

Alexander Graf kvm kvmarm linux-arm-kernel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 14 repliesIn review
  2. v32 patches 24 repliesSuperseded

Changes in v4 from the cover letter

- Improve documentation

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: arm/arm64: Add vcpu ENABLE_CAP functionalityDocumentation/virtual/kvm/api.txt arch/arm/kvm/arm.c+28 -10 replies
2/2KVM: arm/arm64: Route vtimer events to user spaceDocumentation/virtual/kvm/api.txt arch/arm/include/asm/kvm_host.h arch/arm/kvm/arm.c +3 more+155 -4214 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] KVM: ARM: Enable vtimers with user space gic

Some systems out there (well, one type in particular - the Raspberry Pi series) do have virtualization capabilities in the core, but no ARM GIC interrupt controller.

To run on these systems, the cleanest route is to just handle all interrupt delivery in user space and only deal with IRQ pins in the core side in KVM.

This works pretty well already, but breaks when the guest starts to use architected timers, as these are handled straight inside kernel space today.

This patch set allows user space to receive vtimer events as well as mask them, so that we can handle all vtimer related interrupt injection from user space, enabling us to use architected timer with user space gic emulation.

I have successfully run edk2 as well as Linux using these patches on a Raspberry Pi 3 system with acceptable speed.

A branch with WIP QEMU code can be found here:

https://github.com/agraf/qemu.git no-kvm-irqchip

To use the user space irqchip, just run it with

  $ qemu-system-aarch64 -M virt ...

if you're on a non-vgic host system. Or -M virt,kernel-irqchip=off if your host system has vgic support.

v1 -> v2:

- Add back curly brace that got lost

v2 -> v3:

- Fix "only only" in documentation
- Split patches
- Remove kvm_emulate.h include

v3 -> v4:

- Improve documentation

Alexander Graf (2):
KVM: arm/arm64: Add vcpu ENABLE_CAP functionality
KVM: arm/arm64: Route vtimer events to user space

 Documentation/virtual/kvm/api.txt |  34 ++++++++++-
 arch/arm/include/asm/kvm_host.h   |   3 +
 arch/arm/kvm/arm.c                |  47 +++++++++++---
 arch/arm64/include/asm/kvm_host.h |   3 +
 include/uapi/linux/kvm.h          |  14 +++++
 virt/kvm/arm/arch_timer.c         | 125 +++++++++++++++++++++++++++-----------
 6 files changed, 183 insertions(+), 43 deletions(-)
Signature · 1 line
1.8.5.6