mbox series

[0/8] riscv: AIA: kernel-irqchip=off support

Message ID 20250217081730.9000-1-yongxuan.wang@sifive.com (mailing list archive)
Headers show
Series riscv: AIA: kernel-irqchip=off support | expand

Message

Yong-Xuan Wang Feb. 17, 2025, 8:17 a.m. UTC
This series introduces the user-space AIA MSI emulation when using KVM
acceleration.

After this series, RISC-V QEMU virt machine with KVM acceleration has
3 parameters to control the type of irqchip and its emulation method:
- Machine prop "aia" controls the type of irqchip
  - none: use PLIC and emulated in user-space
  - aplic: use AIA wired and emulated in user-space
  - aplic-imsic: use AIA MSI, emulation mode is determined by
    "kernel-irqchip" and "riscv-imsic"
- Accel prop "kernel-irqchip", effective with AIA MSI
  - on: in-kernel APLIC and in-kernel IMSIC
  - off: user-space APLIC and user-space IMSIC
  - split: user-space APLIC and in-kernel IMSIC
- Accel prop "kernel-irqchip", effective with in-kernel IMSIC
  - emul: use MRIF as in-kernel IMSIC
  - hw: use hardware guest IMSIC file as in-kernel IMSIC
  - auto: use the hardware guest IMSICs whenever available otherwise
    fallback to MRIF

Yong-Xuan Wang (8):
  target/riscv/kvm: rewrite get/set for KVM_REG_RISCV_CSR
  target/riscv/kvm: add KVM_REG_RISCV_CSR_AIA
  target/riscv/kvm: add KVM_REG_RISCV_CSR_SMSTATEEN
  target/riscv: add helper to get CSR name
  target/riscv/kvm: rewrite kvm_riscv_handle_csr
  target/riscv/kvm: add CSR_SIREG and CSR_STOPEI emulation
  target/riscv/kvm: rename riscv-aia to riscv-imsic
  docs: update the description about RISC-V AIA

 docs/specs/riscv-aia.rst   |  24 +++-
 docs/system/riscv/virt.rst |  10 +-
 target/riscv/cpu.h         |   8 +-
 target/riscv/csr.c         |  30 ++--
 target/riscv/kvm/kvm-cpu.c | 287 +++++++++++++++++++++++++++++--------
 5 files changed, 266 insertions(+), 93 deletions(-)

Comments

Kashyap Chamarthy Feb. 18, 2025, 3:53 p.m. UTC | #1
On Mon, Feb 17, 2025 at 04:17:20PM +0800, Yong-Xuan Wang wrote:
> This series introduces the user-space AIA MSI emulation when using KVM
> acceleration.
> 
> After this series, RISC-V QEMU virt machine with KVM acceleration has
> 3 parameters to control the type of irqchip and its emulation method:
> - Machine prop "aia" controls the type of irqchip
>   - none: use PLIC and emulated in user-space
>   - aplic: use AIA wired and emulated in user-space
>   - aplic-imsic: use AIA MSI, emulation mode is determined by
>     "kernel-irqchip" and "riscv-imsic"
> - Accel prop "kernel-irqchip", effective with AIA MSI
>   - on: in-kernel APLIC and in-kernel IMSIC
>   - off: user-space APLIC and user-space IMSIC
>   - split: user-space APLIC and in-kernel IMSIC
> - Accel prop "kernel-irqchip", effective with in-kernel IMSIC
>   - emul: use MRIF as in-kernel IMSIC
>   - hw: use hardware guest IMSIC file as in-kernel IMSIC
>   - auto: use the hardware guest IMSICs whenever available otherwise
>     fallback to MRIF

Hi; as someone new to the RISC-V ecosystem, most of these acronyms feel
impenetrable :-)  I see they're all RISC-V interrupt-handling related
terms.  I hope you don't mind my spelling them out here:

  - AIA   : Advanced Interrupt Architecture
  - MSI   : Message Signaled Interrupts
  - PLIC  : Platform-Level Interrupt Controller
  - APLIC : Advanced Platform Level Interrupt Controller
  - IMSIC : Incoming Message Signaled Interrupt Controller
  - MRIF  : Message Routed Interrupt Facility

[...]
Yong-Xuan Wang Feb. 24, 2025, 7:17 a.m. UTC | #2
Hi Kashyap,

On Tue, Feb 18, 2025 at 11:53 PM Kashyap Chamarthy <kchamart@redhat.com> wrote:
>
> On Mon, Feb 17, 2025 at 04:17:20PM +0800, Yong-Xuan Wang wrote:
> > This series introduces the user-space AIA MSI emulation when using KVM
> > acceleration.
> >
> > After this series, RISC-V QEMU virt machine with KVM acceleration has
> > 3 parameters to control the type of irqchip and its emulation method:
> > - Machine prop "aia" controls the type of irqchip
> >   - none: use PLIC and emulated in user-space
> >   - aplic: use AIA wired and emulated in user-space
> >   - aplic-imsic: use AIA MSI, emulation mode is determined by
> >     "kernel-irqchip" and "riscv-imsic"
> > - Accel prop "kernel-irqchip", effective with AIA MSI
> >   - on: in-kernel APLIC and in-kernel IMSIC
> >   - off: user-space APLIC and user-space IMSIC
> >   - split: user-space APLIC and in-kernel IMSIC
> > - Accel prop "kernel-irqchip", effective with in-kernel IMSIC
> >   - emul: use MRIF as in-kernel IMSIC
> >   - hw: use hardware guest IMSIC file as in-kernel IMSIC
> >   - auto: use the hardware guest IMSICs whenever available otherwise
> >     fallback to MRIF
>
> Hi; as someone new to the RISC-V ecosystem, most of these acronyms feel
> impenetrable :-)  I see they're all RISC-V interrupt-handling related
> terms.  I hope you don't mind my spelling them out here:
>
>   - AIA   : Advanced Interrupt Architecture
>   - MSI   : Message Signaled Interrupts
>   - PLIC  : Platform-Level Interrupt Controller
>   - APLIC : Advanced Platform Level Interrupt Controller
>   - IMSIC : Incoming Message Signaled Interrupt Controller
>   - MRIF  : Message Routed Interrupt Facility
>
> [...]
>
> --
> /kashyap
>

Sure. I would add them into the next version. Thank you!

Regards,
Yong-Xuan