[PATCH 0/8] riscv: AIA userspace irqchip_split support

Daniel Henrique Barboza posted 8 patches 1 month, 2 weeks ago
There is a newer version of this series
docs/specs/index.rst          |  1 +
docs/specs/riscv-aia.rst      | 83 +++++++++++++++++++++++++++++++++++
docs/system/riscv/virt.rst    |  7 +++
hw/intc/riscv_aplic.c         | 68 ++++++++++++++++++++++------
hw/riscv/virt.c               | 38 +++++++++++-----
include/hw/intc/riscv_aplic.h |  8 ++++
target/riscv/kvm/kvm-cpu.c    | 41 +++++++++--------
7 files changed, 202 insertions(+), 44 deletions(-)
create mode 100644 docs/specs/riscv-aia.rst
[PATCH 0/8] riscv: AIA userspace irqchip_split support
Posted by Daniel Henrique Barboza 1 month, 2 weeks ago
Hi,

This series adds AIA irqchip_split support, effective when using AIA
with aia=aplic-imsic and -accel kvm,kernel-irqchip=split. 

The main difference between what we currently have and irqchip_split()
mode is that, when using split mode, QEMU will emulate the APLIC
controller instead of using the in-kernel APLIC controller provided by
KVM.

After this series this is the matrix of which interrupt controllers
we're emulating based on 'virt' machine configuration and accelerator
properties:

Accel Accel props   AIA type    APLIC-m IMSIC-m APLIC-s   IMSIC-s
tcg      ----       aplic       emul    n/a     emul      n/a
tcg      ----       aplic-imsic emul    emul    emul      emul
kvm      ----       aplic       n/a     n/a     emul      n/a
kvm      none       aplic-imsic n/a     n/a     in-kernel in-kernel
kvm   irqchip=split aplic-imsic n/a     n/a     emul      in-kernel


Patches based on alistair/riscv-to-apply.next.

Daniel Henrique Barboza (8):
  hw/intc/riscv_aplic: rename is_kvm_aia()
  hw/riscv/virt.c: reduce virt_use_kvm_aia() usage
  hw/riscv/virt.c: rename helper to virt_use_kvm_aia_aplic_imsic()
  target/riscv/kvm: consider irqchip_split() in aia_create()
  hw/riscv/virt.c, riscv_aplic.c: add 'emulated_aplic' helpers
  hw/intc/riscv_aplic: add kvm_msicfgaddr for split mode aplic-imsic
  target/riscv/kvm: remove irqchip_split() restriction
  docs: update riscv/virt.rst with kernel-irqchip=split support

 docs/specs/index.rst          |  1 +
 docs/specs/riscv-aia.rst      | 83 +++++++++++++++++++++++++++++++++++
 docs/system/riscv/virt.rst    |  7 +++
 hw/intc/riscv_aplic.c         | 68 ++++++++++++++++++++++------
 hw/riscv/virt.c               | 38 +++++++++++-----
 include/hw/intc/riscv_aplic.h |  8 ++++
 target/riscv/kvm/kvm-cpu.c    | 41 +++++++++--------
 7 files changed, 202 insertions(+), 44 deletions(-)
 create mode 100644 docs/specs/riscv-aia.rst

-- 
2.45.2
Re: [PATCH 0/8] riscv: AIA userspace irqchip_split support
Posted by Alistair Francis 5 days, 18 hours ago
On Fri, Oct 11, 2024 at 5:04 AM Daniel Henrique Barboza
<dbarboza@ventanamicro.com> wrote:
>
> Hi,
>
> This series adds AIA irqchip_split support, effective when using AIA
> with aia=aplic-imsic and -accel kvm,kernel-irqchip=split.
>
> The main difference between what we currently have and irqchip_split()
> mode is that, when using split mode, QEMU will emulate the APLIC
> controller instead of using the in-kernel APLIC controller provided by
> KVM.
>
> After this series this is the matrix of which interrupt controllers
> we're emulating based on 'virt' machine configuration and accelerator
> properties:
>
> Accel Accel props   AIA type    APLIC-m IMSIC-m APLIC-s   IMSIC-s
> tcg      ----       aplic       emul    n/a     emul      n/a
> tcg      ----       aplic-imsic emul    emul    emul      emul
> kvm      ----       aplic       n/a     n/a     emul      n/a
> kvm      none       aplic-imsic n/a     n/a     in-kernel in-kernel
> kvm   irqchip=split aplic-imsic n/a     n/a     emul      in-kernel
>
>
> Patches based on alistair/riscv-to-apply.next.

Thanks!

Do you mind rebasing this again?

Alistair
Re: [PATCH 0/8] riscv: AIA userspace irqchip_split support
Posted by Daniel Henrique Barboza 4 days, 1 hour ago

On 11/17/24 11:05 PM, Alistair Francis wrote:
> On Fri, Oct 11, 2024 at 5:04 AM Daniel Henrique Barboza
> <dbarboza@ventanamicro.com> wrote:
>>
>> Hi,
>>
>> This series adds AIA irqchip_split support, effective when using AIA
>> with aia=aplic-imsic and -accel kvm,kernel-irqchip=split.
>>
>> The main difference between what we currently have and irqchip_split()
>> mode is that, when using split mode, QEMU will emulate the APLIC
>> controller instead of using the in-kernel APLIC controller provided by
>> KVM.
>>
>> After this series this is the matrix of which interrupt controllers
>> we're emulating based on 'virt' machine configuration and accelerator
>> properties:
>>
>> Accel Accel props   AIA type    APLIC-m IMSIC-m APLIC-s   IMSIC-s
>> tcg      ----       aplic       emul    n/a     emul      n/a
>> tcg      ----       aplic-imsic emul    emul    emul      emul
>> kvm      ----       aplic       n/a     n/a     emul      n/a
>> kvm      none       aplic-imsic n/a     n/a     in-kernel in-kernel
>> kvm   irqchip=split aplic-imsic n/a     n/a     emul      in-kernel
>>
>>
>> Patches based on alistair/riscv-to-apply.next.
> 
> Thanks!
> 
> Do you mind rebasing this again?

Thanks for the reviews!

I'm not sure which branch should I use for rebasing (it doesn't seem that your
riscv-to-apply.next or riscv-to-apply.for-upstream branches are updated), so I rebased
it on top of 'master', fixed a couple of conflicts.

Let me know if you want a rebase based on a different branch. Thanks,

Daniel

> 
> Alistair