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-aia". This can only be used
    when the host machine support the AIA extension.
- 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 "riscv-aia", 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

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

---
v2:
- Add glossary of RISC-V irqchips in cover letter (Kashyap)
- Add assertions in riscv_get_csr_name() of PATCH4 (Andrew)
- remove the changing of property name (Andrew)
- Add PATCH8 to prevent the usage of IMSIC devices when the host
  machine doesn't support the AIA extension.
- fix typo in cover letter

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
  docs: update the description about RISC-V AIA
  hw/intc/imsic: prevent to use IMSIC when host doesn't support AIA
    extension

 docs/specs/riscv-aia.rst   |  24 +++-
 docs/system/riscv/virt.rst |  10 +-
 hw/intc/riscv_imsic.c      |  17 ++-
 target/riscv/cpu.h         |  10 +-
 target/riscv/csr.c         |  30 ++---
 target/riscv/kvm/kvm-cpu.c | 235 +++++++++++++++++++++++++++++++------
 6 files changed, 254 insertions(+), 72 deletions(-)

-- 
2.17.1


Reply via email to