Skip to content

RISC-V: KVM: AIA: Convert HGEI management to fully per-HART

[email protected] kvm kvm-riscv linux-riscv lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesIn review
  2. v13 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Add per-HART IMSIC guest files to compute final HGEI count.
- Add min(local->nr_guest_files, nr_guest_files);

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4RISC-V: KVM: AIA: Make HGEI number and management fully per-CPUarch/riscv/kvm/aia.c+24 -162 replies
2/4RISC-V: KVM: AIA: Replace global HGEI count with simple enabled boolarch/riscv/include/asm/kvm_aia.h arch/riscv/kvm/aia.c arch/riscv/kvm/aia_device.c +1 more+12 -151 reply
3/4irqchip/riscv-imsic: Move nr_guest_files to per-HART local configdrivers/irqchip/irq-riscv-imsic-state.c include/linux/irqchip/riscv-imsic.h+9 -73 replies
4/4RISC-V: KVM: AIA: Use per-HART IMSIC guest files to compute final HGEI countarch/riscv/kvm/aia.c+10 -20 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchThomas Gleixner
1/4
2/4
3/4A-b
4/4

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

Read the v2 thread

Cover letter [PATCH V2 0/4] RISC-V: KVM: AIA: Convert HGEI management to fully per-HART

From: "Guo Ren (Alibaba DAMO Academy)" <[email protected]>

This short series converts RISC-V KVM AIA's Hypervisor Guest External Interrupt (HGEI) line management from a global "one-size-fits-all" model to a fully per-HART (per-CPU) model. It also performs the corresponding cleanup in the IMSIC irqchip driver.

The motivation is to properly support heterogeneous RISC-V SoCs (big.LITTLE, multi-vendor core mixes) where different HARTs may expose different numbers of guest interrupt files / HGEIE bits. The old global kvm_riscv_aia_nr_hgei and imsic_global_config::nr_guest_files assumptions are no longer tenable and are removed.

After this series, HGEI allocation, freeing, and interrupt delivery are completely per-HART, the code is simpler and clearer, and there are no remaining global assumptions about guest interrupt file counts.

Changelog:
V2:
- Add per-HART IMSIC guest files to compute final HGEI count.
- Add min(local->nr_guest_files, nr_guest_files);

V1:
https://lore.kernel.org/kvm-riscv/[email protected]/

Guo Ren (Alibaba DAMO Academy) (4):
RISC-V: KVM: AIA: Make HGEI number and management fully per-CPU
RISC-V: KVM: AIA: Replace global HGEI count with simple enabled bool irqchip/riscv-imsic: Move nr_guest_files to per-HART local config
RISC-V: KVM: AIA: Use per-HART IMSIC guest files to compute final HGEI
count

 arch/riscv/include/asm/kvm_aia.h        |  2 +-
 arch/riscv/kvm/aia.c                    | 66 +++++++++++++++----------
 arch/riscv/kvm/aia_device.c             |  4 +-
 arch/riscv/kvm/main.c                   |  3 +-
 drivers/irqchip/irq-riscv-imsic-state.c | 10 ++--
 include/linux/irqchip/riscv-imsic.h     |  6 +--
 6 files changed, 53 insertions(+), 38 deletions(-)
Signature · 1 line
2.43.0