[PATCH 0/5] hw/riscv: Fix minimal RISC-V system builds

Tan Chi posted 5 patches 3 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261101031547.125591-1-tanchi25@mails.ucas.ac.cn
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>
hw/riscv/Kconfig               |  6 ++++++
hw/riscv/aia.c                 | 11 -----------
hw/riscv/aia.h                 | 17 ++++++++++++++++-
hw/riscv/fdt-common.c          | 13 ++-----------
hw/riscv/meson.build           |  5 +++--
hw/riscv/server_platform_ref.c |  9 +++++++--
hw/riscv/virt.c                | 21 ++++++++++++++++++---
include/hw/riscv/fdt-common.h  |  3 +--
target/riscv/kvm/kvm-cpu.c     | 10 +++++-----
target/riscv/kvm/kvm-stub.c    |  3 ++-
target/riscv/kvm/kvm_riscv.h   |  5 ++++-
11 files changed, 64 insertions(+), 39 deletions(-)
[PATCH 0/5] hw/riscv: Fix minimal RISC-V system builds
Posted by Tan Chi 3 weeks, 1 day ago
While testing minimal RISC-V KVM builds following feedback on my MSI
address translation patch, I encountered several build dependency
issues hidden by the default device configurations.

The failures can be reproduced on a RISC-V Linux host with the
following device configuration:

    configs/devices/riscv64-softmmu/matrix-sifive-e.mak:
    CONFIG_SIFIVE_E=y

and configure options:

    ../configure \
        --target-list=riscv64-softmmu \
        --enable-kvm \
        --without-default-devices \
        --with-devices-riscv64=matrix-sifive-e

Without these fixes, the build fails to link with undefined references
to APLIC, GPEX, platform bus, and RISC-V NUMA helpers. These dependencies
are normally hidden by the default device configurations.

The first four patches fix these issues by making AIA and device
helpers conditional, moving platform bus FDT creation to the machines
that use it, and passing socket topology directly to KVM AIA.

The fifth patch fixes a separate missing SSI dependency found when
building a minimal RV32 OpenTitan configuration.

The affected minimal configurations and default-device RV32/RV64
builds were tested.

Tan Chi (5):
  hw/riscv: Build AIA glue only with APLIC and IMSIC
  hw/riscv: Build device-common only for its users
  hw/riscv: Move platform bus FDT creation to machine code
  hw/riscv: Pass socket topology to KVM AIA
  hw/riscv: Select SSI for IBEX

 hw/riscv/Kconfig               |  6 ++++++
 hw/riscv/aia.c                 | 11 -----------
 hw/riscv/aia.h                 | 17 ++++++++++++++++-
 hw/riscv/fdt-common.c          | 13 ++-----------
 hw/riscv/meson.build           |  5 +++--
 hw/riscv/server_platform_ref.c |  9 +++++++--
 hw/riscv/virt.c                | 21 ++++++++++++++++++---
 include/hw/riscv/fdt-common.h  |  3 +--
 target/riscv/kvm/kvm-cpu.c     | 10 +++++-----
 target/riscv/kvm/kvm-stub.c    |  3 ++-
 target/riscv/kvm/kvm_riscv.h   |  5 ++++-
 11 files changed, 64 insertions(+), 39 deletions(-)

-- 
2.53.0
Re: [PATCH 0/5] hw/riscv: Fix minimal RISC-V system builds
Posted by Alistair Francis 2 weeks, 3 days ago
On Sun, 2026-11-01 at 11:15 +0800, Tan Chi wrote:
> While testing minimal RISC-V KVM builds following feedback on my MSI
> address translation patch, I encountered several build dependency
> issues hidden by the default device configurations.
> 
> The failures can be reproduced on a RISC-V Linux host with the
> following device configuration:
> 
>     configs/devices/riscv64-softmmu/matrix-sifive-e.mak:
>     CONFIG_SIFIVE_E=y
> 
> and configure options:
> 
>     ../configure \
>         --target-list=riscv64-softmmu \
>         --enable-kvm \
>         --without-default-devices \
>         --with-devices-riscv64=matrix-sifive-e
> 
> Without these fixes, the build fails to link with undefined
> references
> to APLIC, GPEX, platform bus, and RISC-V NUMA helpers. These
> dependencies
> are normally hidden by the default device configurations.
> 
> The first four patches fix these issues by making AIA and device
> helpers conditional, moving platform bus FDT creation to the machines
> that use it, and passing socket topology directly to KVM AIA.
> 
> The fifth patch fixes a separate missing SSI dependency found when
> building a minimal RV32 OpenTitan configuration.
> 
> The affected minimal configurations and default-device RV32/RV64
> builds were tested.
> 
> Tan Chi (5):
>   hw/riscv: Build AIA glue only with APLIC and IMSIC
>   hw/riscv: Build device-common only for its users
>   hw/riscv: Move platform bus FDT creation to machine code
>   hw/riscv: Pass socket topology to KVM AIA
>   hw/riscv: Select SSI for IBEX

Thanks!

Applied to riscv-to-apply.next

Alistair

> 
>  hw/riscv/Kconfig               |  6 ++++++
>  hw/riscv/aia.c                 | 11 -----------
>  hw/riscv/aia.h                 | 17 ++++++++++++++++-
>  hw/riscv/fdt-common.c          | 13 ++-----------
>  hw/riscv/meson.build           |  5 +++--
>  hw/riscv/server_platform_ref.c |  9 +++++++--
>  hw/riscv/virt.c                | 21 ++++++++++++++++++---
>  include/hw/riscv/fdt-common.h  |  3 +--
>  target/riscv/kvm/kvm-cpu.c     | 10 +++++-----
>  target/riscv/kvm/kvm-stub.c    |  3 ++-
>  target/riscv/kvm/kvm_riscv.h   |  5 ++++-
>  11 files changed, 64 insertions(+), 39 deletions(-)