[PATCH 0/2] hw/intc/riscv_aplic: Expand AIA target[i] source handling and refactor related code

Nikita Novikov posted 2 patches 2 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251029-n-novikov-aplic._5Faia._5Fro-v1-0-39fec74c918a@syntacore.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
hw/intc/riscv_aplic.c | 66 ++++++++++++++++++++++-----------------------------
1 file changed, 29 insertions(+), 37 deletions(-)
[PATCH 0/2] hw/intc/riscv_aplic: Expand AIA target[i] source handling and refactor related code
Posted by Nikita Novikov 2 weeks, 2 days ago
During the debug of APLIC I faced with the problem with target[i]
registers of source i. According to RISC-V AIA spec v1.0 ratificated on
the 12-th of March, 2025, the section 4.5.2 ("Source configurations")
says, than register target[i] shall be read-only zero when interrupt source i
is inactive in this domain. A source is inactive if it is delegated to a child
domain or its source mode is INACTIVE. Currently we checks the source status
only using sm == INACTIVE, but we do not check whether the source is
delegated.

This series of patches expands current active source checking and reduces
code the associated code dublication.

Signed-off-by: Nikita Novikov <n.novikov@syntacore.com>
---
Nikita Novikov (2):
      hw/intc/riscv_aplic: Expand inactive source handling for AIA target[i]
      hw/intc/riscv_aplic: Factor out source_active() and remove duplicate checks

 hw/intc/riscv_aplic.c | 66 ++++++++++++++++++++++-----------------------------
 1 file changed, 29 insertions(+), 37 deletions(-)
---
base-commit: d1bf06e8cc8197a2b18dbde820d957a51899d374
change-id: 20251028-n-novikov-aplic_aia_ro-1baa353cd672

Best regards,
-- 
Nikita Novikov <n.novikov@syntacore.com>
Re: [PATCH 0/2] hw/intc/riscv_aplic: Expand AIA target[i] source handling and refactor related code
Posted by Alistair Francis 2 days, 15 hours ago
On Wed, Oct 29, 2025 at 5:20 PM Nikita Novikov <n.novikov@syntacore.com> wrote:
>
> During the debug of APLIC I faced with the problem with target[i]
> registers of source i. According to RISC-V AIA spec v1.0 ratificated on
> the 12-th of March, 2025, the section 4.5.2 ("Source configurations")
> says, than register target[i] shall be read-only zero when interrupt source i
> is inactive in this domain. A source is inactive if it is delegated to a child
> domain or its source mode is INACTIVE. Currently we checks the source status
> only using sm == INACTIVE, but we do not check whether the source is
> delegated.
>
> This series of patches expands current active source checking and reduces
> code the associated code dublication.
>
> Signed-off-by: Nikita Novikov <n.novikov@syntacore.com>
> ---
> Nikita Novikov (2):
>       hw/intc/riscv_aplic: Expand inactive source handling for AIA target[i]
>       hw/intc/riscv_aplic: Factor out source_active() and remove duplicate checks

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  hw/intc/riscv_aplic.c | 66 ++++++++++++++++++++++-----------------------------
>  1 file changed, 29 insertions(+), 37 deletions(-)
> ---
> base-commit: d1bf06e8cc8197a2b18dbde820d957a51899d374
> change-id: 20251028-n-novikov-aplic_aia_ro-1baa353cd672
>
> Best regards,
> --
> Nikita Novikov <n.novikov@syntacore.com>
>
>