Skip to content

Support userspace irqchip with arch timers

Christoffer Dall 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. v3 Latest5 patches 10 repliesIn review
  2. v25 patches 4 repliesSuperseded

Changes in v3 from the cover letter

- Actually push the right content to the kernel branch, sorry.
- Rebased on kvmarm/queue as of this morning (v4.11-rc1+ stuff)
- Changed IOCTL numbers as needed

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5KVM: arm/arm64: Cleanup the arch timer code's irqchip checkingvirt/kvm/arm/arch_timer.c+7 -80 replies
2/5KVM: arm/arm64: Add ARM user space interrupt signaling ABIDocumentation/virtual/kvm/api.txt arch/arm/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h +1 more+54 -00 replies
3/5KVM: arm/arm64: Support arch timers with a userspace gicarch/arm/kvm/arm.c include/kvm/arm_arch_timer.h virt/kvm/arm/arch_timer.c+110 -324 replies
4/5KVM: arm/arm64: Report PMU overflow interrupts to userspace irqchiparch/arm/kvm/arm.c include/kvm/arm_pmu.h virt/kvm/arm/pmu.c+51 -72 replies
5/5KVM: arm/arm64: Advertise support for KVM_CAP_ARM_USER_IRQarch/arm/kvm/arm.c+7 -01 reply

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlexander GrafMarc Zyngier
SeriesR-b R-b
1/5
2/5
3/5
4/5
5/5

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

Read the v3 thread

Cover letter [PATCH v3 0/5] Support userspace irqchip with arch timers

This series is the second version of the rework of the patches to support architected timers with a userspace irqchip sent by Alexander Graf [1].

We first cleanup some of the timer code to make it easier to understand what is being done in the later patches, and then define the ABI, implement timers support, implement PMU support, and finally advertise the features.

These patches are based on the recent work from Jintack to support the physical timer in addition to the virtual timer. This series including its dependencies can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/cdall/linux.git irqs-to-user-v3

I tested this using Alex's QEMU patch with his fixes for SMP applied. This seems to be rock-solid. The temporary-not-for-upstream-but-for-testing patch can be found here (force-pushed and rebased since v2):

https://git.linaro.org/people/christoffer.dall/qemu-arm.git no-kvm-irqchip

I also tested it on 32-bit and it looks good there as well.

Changes since v2:
- Actually push the right content to the kernel branch, sorry.
- Rebased on kvmarm/queue as of this morning (v4.11-rc1+ stuff)
- Changed IOCTL numbers as needed

Changes since v1:
- Rework the ABI to support devices in general as opposed to just timers
- Support the PMU in addition to timers
- Also support the physical timer (rebased on Jintack's work)
- Updated some comments where I noticed things were out of date.

Several changes have been made compared to v7 of the original single patch, including:
- Rewording ABI documentation to be more in line with the ARM architecture
- Add an explicit check for needing to notify userspace of a level change instead of propagating the value
- Changes to commenting throughout to more accurately describe the architecture concepts we try to maintain
- Reword of functions, for example from sync to update when the date only flows one direction

[1]: https://lists.cs.columbia.edu/pipermail/kvmarm/2016-September/021867.html
[2]: git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next

Alexander Graf (2):
KVM: arm/arm64: Add ARM user space interrupt signaling ABI
KVM: arm/arm64: Support arch timers with a userspace gic

Christoffer Dall (3):
KVM: arm/arm64: Cleanup the arch timer code's irqchip checking
KVM: arm/arm64: Report PMU overflow interrupts to userspace irqchip
KVM: arm/arm64: Advertise support for KVM_CAP_ARM_USER_IRQ

 Documentation/virtual/kvm/api.txt |  42 +++++++++++++
 arch/arm/include/uapi/asm/kvm.h   |   2 +
 arch/arm/kvm/arm.c                |  28 ++++++---
 arch/arm64/include/uapi/asm/kvm.h |   2 +
 include/kvm/arm_arch_timer.h      |   2 +
 include/kvm/arm_pmu.h             |   7 +++
 include/uapi/linux/kvm.h          |   8 +++
 virt/kvm/arm/arch_timer.c         | 127 ++++++++++++++++++++++++++++++--------
 virt/kvm/arm/pmu.c                |  42 +++++++++++--
 9 files changed, 221 insertions(+), 39 deletions(-)
Signature · 1 line
2.9.0