Skip to content

RISC-V KVM in-kernel AIA irqchip

Anup Patel kvm kvm-riscv linux-riscv lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 3 repliesIn review
  2. v210 patches 5 repliesSuperseded
  3. v110 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Added KVM_CAP_IRQCHIP in PATCH5
- Fix check for KVM_DEV_RISCV_AIA_CONFIG_IDS write in PATCH6
- Fix APLIC_IRQ_STATE_ENPEND usage in PATCH7

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10RISC-V: KVM: Implement guest external interrupt line managementarch/riscv/include/asm/kvm_aia.h arch/riscv/kvm/aia.c arch/riscv/kvm/main.c +1 more+258 -10 replies
2/10RISC-V: KVM: Add IMSIC related definesarch/riscv/include/asm/kvm_aia_imsic.h arch/riscv/kvm/aia.c+39 -20 replies
3/10RISC-V: KVM: Add APLIC related definesarch/riscv/include/asm/kvm_aia_aplic.h+58 -00 replies
4/10RISC-V: KVM: Set kvm_riscv_aia_nr_hgei to zeroarch/riscv/kvm/aia.c+9 -10 replies
5/10RISC-V: KVM: Skeletal in-kernel AIA irqchip supportarch/riscv/include/asm/kvm_aia.h arch/riscv/include/asm/kvm_host.h arch/riscv/include/uapi/asm/kvm.h +3 more+158 -00 replies
6/10RISC-V: KVM: Implement device interface for AIA irqchiparch/riscv/include/asm/kvm_aia.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/Makefile +3 more+772 -420 replies
7/10RISC-V: KVM: Add in-kernel emulation of AIA APLICarch/riscv/include/asm/kvm_aia.h arch/riscv/kvm/Makefile arch/riscv/kvm/aia_aplic.c+580 -141 reply
8/10RISC-V: KVM: Expose APLIC registers as attributes of AIA irqchiparch/riscv/include/asm/kvm_aia.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/aia_aplic.c +1 more+77 -01 reply
9/10RISC-V: KVM: Add in-kernel virtualization of AIA IMSICarch/riscv/include/asm/kvm_aia.h arch/riscv/kvm/Makefile arch/riscv/kvm/aia_imsic.c+924 -360 replies
10/10RISC-V: KVM: Expose IMSIC registers as attributes of AIA irqchiparch/riscv/include/asm/kvm_aia.h arch/riscv/include/uapi/asm/kvm.h arch/riscv/kvm/aia_device.c +1 more+217 -20 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchAndrew JonesAtish Patra
1/10R-b R-b
2/10R-b
3/10R-b
4/10R-b
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

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 00/10] RISC-V KVM in-kernel AIA irqchip

This series adds in-kernel AIA irqchip to KVM RISC-V which trap-n-emulate IMSIC and APLIC MSI-mode for Guest. The APLIC MSI-mode trap-n-emulate is optional so KVM user space can emulate APLIC entirely in user space.

The use of IMSIC HW guest files to accelerate IMSIC virtualization will be done as separate series since this depends on AIA irqchip drivers to be upstreamed. This series has no dependency on the AIA irqchip drivers.

There is also a KVM AIA irq-bypass (or device MSI virtualization) series under development which depends on this series and upcoming IOMMU driver series.

These patches (or this series) can also be found in the riscv_kvm_aia_irqchip_v3 branch at: https://github.com/avpatel/linux.git

Changes since v2:
- Added KVM_CAP_IRQCHIP in PATCH5
- Fix check for KVM_DEV_RISCV_AIA_CONFIG_IDS write in PATCH6
- Fix APLIC_IRQ_STATE_ENPEND usage in PATCH7

Changes since v1:
- Rebased on Linux-6.4-rc6
- Addressed Atish's comment in PATCH6
- Added comments in arch/riscv/include/uapi/asm/kvm.h about APLIC and IMSIC device attribute type

Anup Patel (10):
RISC-V: KVM: Implement guest external interrupt line management
RISC-V: KVM: Add IMSIC related defines
RISC-V: KVM: Add APLIC related defines
RISC-V: KVM: Set kvm_riscv_aia_nr_hgei to zero
RISC-V: KVM: Skeletal in-kernel AIA irqchip support
RISC-V: KVM: Implement device interface for AIA irqchip
RISC-V: KVM: Add in-kernel emulation of AIA APLIC
RISC-V: KVM: Expose APLIC registers as attributes of AIA irqchip
RISC-V: KVM: Add in-kernel virtualization of AIA IMSIC
RISC-V: KVM: Expose IMSIC registers as attributes of AIA irqchip

 arch/riscv/include/asm/kvm_aia.h       |  107 ++-
 arch/riscv/include/asm/kvm_aia_aplic.h |   58 ++
 arch/riscv/include/asm/kvm_aia_imsic.h |   38 +
 arch/riscv/include/asm/kvm_host.h      |    4 +
 arch/riscv/include/uapi/asm/kvm.h      |   72 ++
 arch/riscv/kvm/Kconfig                 |    4 +
 arch/riscv/kvm/Makefile                |    3 +
 arch/riscv/kvm/aia.c                   |  274 +++++-
 arch/riscv/kvm/aia_aplic.c             |  619 ++++++++++++++
 arch/riscv/kvm/aia_device.c            |  673 +++++++++++++++
 arch/riscv/kvm/aia_imsic.c             | 1083 ++++++++++++++++++++++++
 arch/riscv/kvm/main.c                  |    3 +-
 arch/riscv/kvm/vcpu.c                  |    2 +
 arch/riscv/kvm/vm.c                    |  118 +++
 include/uapi/linux/kvm.h               |    2 +
 15 files changed, 3027 insertions(+), 33 deletions(-)
 create mode 100644 arch/riscv/include/asm/kvm_aia_aplic.h
 create mode 100644 arch/riscv/include/asm/kvm_aia_imsic.h
 create mode 100644 arch/riscv/kvm/aia_aplic.c
 create mode 100644 arch/riscv/kvm/aia_device.c
 create mode 100644 arch/riscv/kvm/aia_imsic.c
Signature · 1 line
2.34.1