Skip to contentSkip to conversation

hw/riscv: Server Platform Reference Board

PATCH Superseded Daniel Henrique Barboza 5 participants 20 messages Apr 24 – May 18

Subsystems (2)

v5 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

v5 cover hw/riscv: Server Platform Reference Board

Greetings,

In this new version the main change is that now we're no longer claiming an 'experimental' support, like we did in v4, because at this moment (well, when sdext [1] is upstreamed) we have all extensions required to support this reference board.

Another major change is the rename of the CPU and the board: we're naming both 'riscv-server-ref' instead of 'rvsp-ref'. We're keeping the "-ref" suffix to match what ARM does with its reference board (sbsa-ref), but adding a longer name to be clearer about what the board is.

Patches patches are based on alistair/riscv-to-apply.next @56bbd4f25c, plus Chao Liu's series "[PATCH v6 0/7] riscv: add initial sdext support" [1]. For convenience this series is available at this branch:

https://gitlab.com/danielhb/qemu/-/tree/riscv-server-ref_v5

Changes from v4:
- removed 'experimental' qualifier from the board description;
- changed CPU name from "rvsp-ref" to "riscv-server-ref"
- changed board name from "rvsp-ref" to "riscv-server-ref"
- former patch 4 ("hw/riscv/server_platform_ref.c: add riscv-iommu-sys"):
- squashed into patch 3
- v4 link: https://lore.kernel.org/qemu-devel/[email protected]/

[1] https://lore.kernel.org/qemu-devel/[email protected]/

Daniel Henrique Barboza (2):
target/riscv/cpu.c: remove 'bare' condition for .profile
docs: add riscv-server-ref.rst

Fei Wu (2):
target/riscv: Add server platform reference cpu
hw/riscv: server platform reference machine

 configs/devices/riscv64-softmmu/default.mak |    1 +
 docs/system/riscv/riscv-server-ref.rst      |   31 +
 docs/system/target-riscv.rst                |    1 +
 hw/riscv/Kconfig                            |   15 +
 hw/riscv/meson.build                        |    1 +
 hw/riscv/server_platform_ref.c              | 1371 +++++++++++++++++++
 target/riscv/cpu-qom.h                      |    1 +
 target/riscv/cpu.c                          |   12 +-
 8 files changed, 1432 insertions(+), 1 deletion(-)
 create mode 100644 docs/system/riscv/riscv-server-ref.rst
 create mode 100644 hw/riscv/server_platform_ref.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v5 1/4 target/riscv/cpu.c: remove 'bare' condition for .profile

We want to configure other CPU types to use profiles as an alternative to adding every profile extension explicitly, i.e. a profile is nothing more than an extension bundle.

This means that a vendor CPU can set .profile=rva23s64 while having the same handling as any other vendor CPU. Same thing with all other CPU types.

---
 target/riscv/cpu.c | 1 -
 1 file changed, 1 deletion(-)
target/riscv/cpu.c +0 -1
index a81485981c..586683b28a 100644
@@ -2863,7 +2863,6 @@ static void riscv_cpu_class_base_init(ObjectClass *c, const void *data)
         mcc->def->bare |= def->bare;
         if (def->profile) {
             assert(profile_extends(def->profile, mcc->def->profile));
-            assert(mcc->def->bare);
             mcc->def->profile = def->profile;
         }
         if (def->misa_mxl_max) {
Signature · 1 line
2.43.0
Reviewed-by on v5 1/4
#2 lore raw

Re: [PATCH v5 1/4] target/riscv/cpu.c: remove 'bare' condition for .profile

Quoted 11 lines · Daniel Henrique Barboza

We want to configure other CPU types to use profiles as an alternative to adding every profile extension explicitly, i.e. a profile is nothing more than an extension bundle.

This means that a vendor CPU can set .profile=rva23s64 while having the same handling as any other vendor CPU. Same thing with all other CPU types.

Alistair

Quoted 20 lines
---
 target/riscv/cpu.c | 1 -
 1 file changed, 1 deletion(-)
target/riscv/cpu.c +0 -2
index a81485981c..586683b28a 100644
@@ -2863,7 +2863,6 @@ static void riscv_cpu_class_base_init(ObjectClass *c, const void *data)
         mcc->def->bare |= def->bare;
         if (def->profile) {
             assert(profile_extends(def->profile, mcc->def->profile));
-            assert(mcc->def->bare);
             mcc->def->profile = def->profile;
         }
         if (def->misa_mxl_max) {
--

2.43.0

#3 lore raw

PATCH v5 2/4 target/riscv: Add server platform reference cpu

In reply to Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The harts requirements of RISC-V server platform [1] require RVA23 ISA profile support and others.

This patch provides a new "riscv-server-ref" CPU to go along with the future "riscv-server-ref" board.

[1] https://github.com/riscv-non-isa/riscv-server-platform/blob/main/server_platform_requirements.adoc

---
 target/riscv/cpu-qom.h |  1 +
 target/riscv/cpu.c     | 11 +++++++++++
 2 files changed, 12 insertions(+)
target/riscv/cpu-qom.h +1 -0
index 30dcdcfaae..a150acd151 100644
@@ -42,6 +42,7 @@
 #define TYPE_RISCV_CPU_RVA22S64         RISCV_CPU_TYPE_NAME("rva22s64")
 #define TYPE_RISCV_CPU_RVA23U64         RISCV_CPU_TYPE_NAME("rva23u64")
 #define TYPE_RISCV_CPU_RVA23S64         RISCV_CPU_TYPE_NAME("rva23s64")
+#define TYPE_RISCV_CPU_RVSERVER_REF     RISCV_CPU_TYPE_NAME("riscv-server-ref")
 #define TYPE_RISCV_CPU_IBEX             RISCV_CPU_TYPE_NAME("lowrisc-ibex")
 #define TYPE_RISCV_CPU_SHAKTI_C         RISCV_CPU_TYPE_NAME("shakti-c")
 #define TYPE_RISCV_CPU_SIFIVE_E         RISCV_CPU_TYPE_NAME("sifive-e")
target/riscv/cpu.c +11 -0
index 586683b28a..4b59dcabff 100644
@@ -3401,6 +3401,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
 #endif
     ),
 
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSERVER_REF, TYPE_RISCV_BARE_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = true,
+        .cfg.ext_sdext = true,
+
+        .cfg.max_satp_mode = VM_1_10_SV57,
+    ),
+
 #if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
     DEFINE_RISCV_CPU(TYPE_RISCV_CPU_BASE128, TYPE_RISCV_DYNAMIC_CPU,
         .cfg.max_satp_mode = VM_1_10_SV57,
Signature · 1 line
2.43.0
#4 lore raw

Re: [PATCH v5 2/4] target/riscv: Add server platform reference cpu

Quoted 37 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The harts requirements of RISC-V server platform [1] require RVA23 ISA profile support and others.

This patch provides a new "riscv-server-ref" CPU to go along with the future "riscv-server-ref" board.

[1] https://github.com/riscv-non-isa/riscv-server-platform/blob/main/server_platform_requirements.adoc

---
 target/riscv/cpu-qom.h |  1 +
 target/riscv/cpu.c     | 11 +++++++++++
 2 files changed, 12 insertions(+)
target/riscv/cpu-qom.h +1 -0
index 30dcdcfaae..a150acd151 100644
@@ -42,6 +42,7 @@
 #define TYPE_RISCV_CPU_RVA22S64         RISCV_CPU_TYPE_NAME("rva22s64")
 #define TYPE_RISCV_CPU_RVA23U64         RISCV_CPU_TYPE_NAME("rva23u64")
 #define TYPE_RISCV_CPU_RVA23S64         RISCV_CPU_TYPE_NAME("rva23s64")
+#define TYPE_RISCV_CPU_RVSERVER_REF     RISCV_CPU_TYPE_NAME("riscv-server-ref")
 #define TYPE_RISCV_CPU_IBEX             RISCV_CPU_TYPE_NAME("lowrisc-ibex")
 #define TYPE_RISCV_CPU_SHAKTI_C         RISCV_CPU_TYPE_NAME("shakti-c")
 #define TYPE_RISCV_CPU_SIFIVE_E         RISCV_CPU_TYPE_NAME("sifive-e")
target/riscv/cpu.c +0 -0
index 586683b28a..4b59dcabff 100644
@@ -3401,6 +3401,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
 #endif
     ),

target/riscv/cpu.c static const TypeInfo riscv_cpu_type_infos[] = { · line 3412

Quoted 10 lines
target/riscv/cpu.c +9 -0
 
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSERVER_REF, TYPE_RISCV_BARE_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = true,
+        .cfg.ext_sdext = true,
+
+        .cfg.max_satp_mode = VM_1_10_SV57,

Why not SV48?

Alistair

#5 lore raw

Re: [PATCH v5 2/4] target/riscv: Add server platform reference cpu

Quoted 40 lines · Alistair Francis
Quoted 38 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The harts requirements of RISC-V server platform [1] require RVA23 ISA profile support and others.

This patch provides a new "riscv-server-ref" CPU to go along with the future "riscv-server-ref" board.

[1] https://github.com/riscv-non-isa/riscv-server-platform/blob/main/server_platform_requirements.adoc

---
  target/riscv/cpu-qom.h |  1 +
  target/riscv/cpu.c     | 11 +++++++++++
  2 files changed, 12 insertions(+)
target/riscv/cpu-qom.h +1 -0
index 30dcdcfaae..a150acd151 100644
@@ -42,6 +42,7 @@
  #define TYPE_RISCV_CPU_RVA22S64         RISCV_CPU_TYPE_NAME("rva22s64")
  #define TYPE_RISCV_CPU_RVA23U64         RISCV_CPU_TYPE_NAME("rva23u64")
  #define TYPE_RISCV_CPU_RVA23S64         RISCV_CPU_TYPE_NAME("rva23s64")
+#define TYPE_RISCV_CPU_RVSERVER_REF     RISCV_CPU_TYPE_NAME("riscv-server-ref")
  #define TYPE_RISCV_CPU_IBEX             RISCV_CPU_TYPE_NAME("lowrisc-ibex")
  #define TYPE_RISCV_CPU_SHAKTI_C         RISCV_CPU_TYPE_NAME("shakti-c")
  #define TYPE_RISCV_CPU_SIFIVE_E         RISCV_CPU_TYPE_NAME("sifive-e")
target/riscv/cpu.c +0 -0
index 586683b28a..4b59dcabff 100644
@@ -3401,6 +3401,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
  #endif
      ),
 
Quoted 11 lines

target/riscv/cpu.c static const TypeInfo riscv_cpu_type_infos[] = { · line 3412

Quoted 9 lines
target/riscv/cpu.c +9 -0
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSERVER_REF, TYPE_RISCV_BARE_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = true,
+        .cfg.ext_sdext = true,
+
+        .cfg.max_satp_mode = VM_1_10_SV57,

Why not SV48?

I tried so hard to come up with a good explanation but failed :) from what I can tell in the version history we changed it from sv48 to sv57 starting on v3, and never looked back. There's no apparent reason/discussion related to this change, therefore I'll assume that this was a fluke.

I'll change it back to sv48 in v6. Thanks,

Daniel

Quoted 2 lines

Alistair

#6 lore raw

Re: [PATCH v5 2/4] target/riscv: Add server platform reference cpu

On Mon, May 04, 2026 at 03:43:30PM -0300, Daniel Henrique Barboza wrote:
...

Quoted 32 lines
Quoted 20 lines
Quoted 20 lines
target/riscv/cpu-qom.h +1 -0
index 30dcdcfaae..a150acd151 100644
@@ -42,6 +42,7 @@
  #define TYPE_RISCV_CPU_RVA22S64         RISCV_CPU_TYPE_NAME("rva22s64")
  #define TYPE_RISCV_CPU_RVA23U64         RISCV_CPU_TYPE_NAME("rva23u64")
  #define TYPE_RISCV_CPU_RVA23S64         RISCV_CPU_TYPE_NAME("rva23s64")
+#define TYPE_RISCV_CPU_RVSERVER_REF     RISCV_CPU_TYPE_NAME("riscv-server-ref")
  #define TYPE_RISCV_CPU_IBEX             RISCV_CPU_TYPE_NAME("lowrisc-ibex")
  #define TYPE_RISCV_CPU_SHAKTI_C         RISCV_CPU_TYPE_NAME("shakti-c")
  #define TYPE_RISCV_CPU_SIFIVE_E         RISCV_CPU_TYPE_NAME("sifive-e")
target/riscv/cpu.c +0 -0
index 586683b28a..4b59dcabff 100644
@@ -3401,6 +3401,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
  #endif
      ),
 
Quoted 11 lines

target/riscv/cpu.c static const TypeInfo riscv_cpu_type_infos[] = { · line 3412

Quoted 9 lines
target/riscv/cpu.c +9 -0
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSERVER_REF, TYPE_RISCV_BARE_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = true,
+        .cfg.ext_sdext = true,
+
+        .cfg.max_satp_mode = VM_1_10_SV57,

Why not SV48?

Quoted 8 lines

I tried so hard to come up with a good explanation but failed :) from what I can tell in the version history we changed it from sv48 to sv57 starting on v3, and never looked back. There's no apparent reason/discussion related to this change, therefore I'll assume that this was a fluke.

I'll change it back to sv48 in v6. Thanks,

Yes, we want sv48 here for the default (base) for the same reason we set the rva23 profile default/base to sv39 - it's the minimum mandate by the spec. That allows users to test their software on the default model in order to ensure compatibility with all conforming implementations. And, in both the server platform and the profile spec cases, additional, optional extension support is allowed, so -cpu riscv-server-ref,sv57=on should also work.

Thanks,
drew

#7 lore raw

PATCH v5 3/4 hw/riscv: server platform reference machine

In reply to Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The RISC-V Server Platform specification [1] defines a standardized set of hardware and software capabilities, that portable system software, such as OS and hypervisors can rely on being present in a RISC-V server platform.

The main features included in this emulation are:

- Based on riscv virt machine type;
- A new memory map as close as virt machine as possible;
- An always present IOMMU platform device (riscv-iommu-sys) that uses IRQs 36 to 39, one IRQ for queue, similar to the 'virt' board;
- AIA;
- PCIe AHCI;
- PCIe NIC;
- No virtio device;
- No fw_cfg device;
- No ACPI table provided;
- Only minimal device tree nodes.

[1] https://github.com/riscv-non-isa/riscv-server-platform

---
 configs/devices/riscv64-softmmu/default.mak |    1 +
 hw/riscv/Kconfig                            |   15 +
 hw/riscv/meson.build                        |    1 +
 hw/riscv/server_platform_ref.c              | 1371 +++++++++++++++++++
 4 files changed, 1388 insertions(+)
 create mode 100644 hw/riscv/server_platform_ref.c
configs/devices/riscv64-softmmu/default.mak +1 -0
index a8e4d0ab33..ae3f62e2d4 100644
@@ -9,6 +9,7 @@
 # CONFIG_SIFIVE_E=n
 # CONFIG_SIFIVE_U=n
 # CONFIG_RISCV_VIRT=n
+# CONFIG_RISCV_SERVER_PLATFORM_REF=n
 # CONFIG_MICROCHIP_PFSOC=n
 # CONFIG_SHAKTI_C=n
 # CONFIG_XIANGSHAN_KUNMINGHU=n
hw/riscv/Kconfig +15 -0
index 0222c93f87..acb3d2fa53 100644
@@ -69,6 +69,21 @@ config RISCV_VIRT
     select ACPI
     select ACPI_PCI
 
+config RISCV_SERVER_PLATFORM_REF
+    bool
+    default y
+    depends on RISCV64
+    select RISCV_NUMA
+    select GOLDFISH_RTC
+    select PCI
+    select PCI_EXPRESS_GENERIC_BRIDGE
+    select PFLASH_CFI01
+    select SERIAL
+    select RISCV_ACLINT
+    select RISCV_APLIC
+    select RISCV_IMSIC
+    select RISCV_IOMMU
+
 config SHAKTI_C
     bool
     default y
hw/riscv/meson.build +1 -0
index 533472e22a..74944cca84 100644
@@ -4,6 +4,7 @@ riscv_ss.add(when: 'CONFIG_RISCV_NUMA', if_true: files('numa.c'))
 riscv_ss.add(files('riscv_hart.c'))
 riscv_ss.add(when: 'CONFIG_OPENTITAN', if_true: files('opentitan.c'))
 riscv_ss.add(when: 'CONFIG_RISCV_VIRT', if_true: files('virt.c'))
+riscv_ss.add(when: 'CONFIG_RISCV_SERVER_PLATFORM_REF', if_true: files('server_platform_ref.c'))
 riscv_ss.add(when: 'CONFIG_SHAKTI_C', if_true: files('shakti_c.c'))
 riscv_ss.add(when: 'CONFIG_SIFIVE_E', if_true: files('sifive_e.c'))
 riscv_ss.add(when: 'CONFIG_SIFIVE_U', if_true: files('sifive_u.c'))
hw/riscv/server_platform_ref.c new file +1371 -0

1,371 lines not on this page · raw message

Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 10 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The RISC-V Server Platform specification [1] defines a standardized set of hardware and software capabilities, that portable system software, such as OS and hypervisors can rely on being present in a RISC-V server platform.

The main features included in this emulation are:

Quoted 11 lines

- Based on riscv virt machine type;
- A new memory map as close as virt machine as possible;
- An always present IOMMU platform device (riscv-iommu-sys) that uses IRQs 36 to 39, one IRQ for queue, similar to the 'virt' board;
- AIA;
- PCIe AHCI;
- PCIe NIC;
- No virtio device;
- No fw_cfg device;
- No ACPI table provided;
- Only minimal device tree nodes.

Can you describe why we actually need/want this? The virt machine already covers a lot of this and OSes and Hypervisors can pretty easily target that. I'm not clear what this buys us in QEMU. Maintaing a machine isn't that hard, but it would be nice to have a good reason to support it.

Also we need machine docs that describe why people should use this machine.

Also, why no ACPI and why device tree? The spec talks about ACPI tables, but I don't see a mention of device tree

Quoted 2 lines

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

So this machine needs to start out with version support (like the ARM virt board)

Alistair

#9 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 24 lines · Alistair Francis
Quoted 10 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The RISC-V Server Platform specification [1] defines a standardized set of hardware and software capabilities, that portable system software, such as OS and hypervisors can rely on being present in a RISC-V server platform.

The main features included in this emulation are:

Quoted 11 lines

- Based on riscv virt machine type;
- A new memory map as close as virt machine as possible;
- An always present IOMMU platform device (riscv-iommu-sys) that uses IRQs 36 to 39, one IRQ for queue, similar to the 'virt' board;
- AIA;
- PCIe AHCI;
- PCIe NIC;
- No virtio device;
- No fw_cfg device;
- No ACPI table provided;
- Only minimal device tree nodes.

Quoted 5 lines

Can you describe why we actually need/want this? The virt machine already covers a lot of this and OSes and Hypervisors can pretty easily target that. I'm not clear what this buys us in QEMU. Maintaing a machine isn't that hard, but it would be nice to have a good reason to support it.

This is an equivalent to sbsa-ref for arm, and the reason is the same:
QEMU is very useful for development and testing (+CI) of firmware and other software
targeting real hardware, whereas virt serves the purpose of being a thin and light way
to spin up virtual machines or do less-hardware-centric kernel development.

Quoted 1 line

Also we need machine docs that describe why people should use this machine.

(Yes, documenting this would be benefitial.)

Quoted 2 lines

Also, why no ACPI and why device tree? The spec talks about ACPI tables, but I don't see a mention of device tree

Because of the abovementioned, the firmware would provide the ACPI support.

Quoted 5 lines
Quoted 2 lines

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

Quoted 8 lines

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

So this machine needs to start out with version support (like the ARM virt board)

We ended up not doing that for sbsa-ref, partially based on advice from Peter (added to cc),
which I can't right now bring to mind in any great detail.

I would expect the same argument holds here. Peter?

But basically the development of this platform will be tracking developments in various
specifications as they expand, as well as having hw features added to it over time, as opposed
to providing a solid foundation to run virtual machines reliably across generations of QEMU.

/
Leif

#10 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 10 lines · Leif Lindholm
Quoted 8 lines · Alistair Francis

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

Quoted 8 lines
Quoted 2 lines

So this machine needs to start out with version support (like the ARM virt board)

We ended up not doing that for sbsa-ref, partially based on advice from Peter (added to cc),
which I can't right now bring to mind in any great detail.

I would expect the same argument holds here. Peter?

Roughly, QEMU versioned machine types are a big maintenance pain, so we should only have them where the use-case is that users really want to be able to run and migrate their workloads from old QEMU to new QEMU. The use case for sbsa-ref is "I am developing the full firmware/system software stack and I want a reference platform for that" -- nobody wants to be able to run the older version of the firmware/software stack on the newer QEMU, and certainly nobody is going to be doing live migration of the software between QEMU versions. The small population of people doing this development work will be running the bleeding edge of all the components involved anyway, and to the extent they care about running on an older / newer QEMU for convenience they can handle that in the firmware -- sbsa-ref passes the firmware a "machine-version-major" and "machine-version-minor" that we bump when we add something that would be a compat break with the firmware.

thanks
-- PMM

#11 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 4 lines · Peter Maydell
Quoted 1 line · Leif Lindholm
Quoted 8 lines
Quoted 8 lines · Alistair Francis
Quoted 7 lines

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

Ah, this was just ratified. So now there is a version 1.0 and no "this may change at any point" notice.

Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

So this machine needs to start out with version support (like the ARM virt board)

We ended up not doing that for sbsa-ref, partially based on advice from Peter (added to cc),
which I can't right now bring to mind in any great detail.

I would expect the same argument holds here. Peter?

Quoted 16 lines

Roughly, QEMU versioned machine types are a big maintenance pain, so we should only have them where the use-case is that users really want to be able to run and migrate their workloads from old QEMU to new QEMU. The use case for sbsa-ref is "I am developing the full firmware/system software stack and I want a reference platform for that" -- nobody wants to be able to run the older version of the firmware/software stack on the newer QEMU, and certainly nobody is going to be doing live migration of the software between QEMU versions. The small population of people doing this development work will be running the bleeding edge of all the components involved anyway, and to the extent they care about running on an older / newer QEMU for convenience they can handle that in the firmware -- sbsa-ref passes the firmware a "machine-version-major" and "machine-version-minor" that we bump when we add something that would be a compat break with the firmware.

Now that the spec is ratified and this isn't expected to change weekly in user breaking ways I agree, thanks Peter

Alistair

#12 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

In reply to Alistair Francis
Quoted 24 lines · Alistair Francis
Quoted 10 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The RISC-V Server Platform specification [1] defines a standardized set of hardware and software capabilities, that portable system software, such as OS and hypervisors can rely on being present in a RISC-V server platform.

The main features included in this emulation are:

Quoted 11 lines

- Based on riscv virt machine type;
- A new memory map as close as virt machine as possible;
- An always present IOMMU platform device (riscv-iommu-sys) that uses IRQs 36 to 39, one IRQ for queue, similar to the 'virt' board;
- AIA;
- PCIe AHCI;
- PCIe NIC;
- No virtio device;
- No fw_cfg device;
- No ACPI table provided;
- Only minimal device tree nodes.

Quoted 5 lines

Can you describe why we actually need/want this? The virt machine already covers a lot of this and OSes and Hypervisors can pretty easily target that. I'm not clear what this buys us in QEMU. Maintaing a machine isn't that hard, but it would be nice to have a good reason to support it.

I'm late to the discussions but following up what Leif and Peter already
commented: this is a similar use case as ARM's sbsa-ref machine. It is a development focused board that adheres to a reference spec, it is not a board to be used for overall consumption - for that we have 'virt'.

If the reference spec changes the emulation will follow suit, and existing software that was working previously can stop working. The assumption made here is that, when a spec change happens, developers must strive to make the SW work on the updated spec/reference machine.

Last but not the least, this design decision also spare us from dealing with machine versioning.

Quoted 2 lines

Also we need machine docs that describe why people should use this machine.

I made an attempt of that in patch 4. I'll improve it to add more details about the machine being a developer focused reference board, not suitable for virtual machines for regular users because the board will follow spec changes that can make existing software misbehave.

Thanks,
Daniel

Quoted 19 lines

Also, why no ACPI and why device tree? The spec talks about ACPI tables, but I don't see a mention of device tree

Quoted 2 lines

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

So this machine needs to start out with version support (like the ARM virt board)

Alistair

#13 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 34 lines · Daniel Henrique Barboza
Quoted 24 lines · Alistair Francis
Quoted 10 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The RISC-V Server Platform specification [1] defines a standardized set of hardware and software capabilities, that portable system software, such as OS and hypervisors can rely on being present in a RISC-V server platform.

The main features included in this emulation are:

Quoted 11 lines

- Based on riscv virt machine type;
- A new memory map as close as virt machine as possible;
- An always present IOMMU platform device (riscv-iommu-sys) that uses IRQs 36 to 39, one IRQ for queue, similar to the 'virt' board;
- AIA;
- PCIe AHCI;
- PCIe NIC;
- No virtio device;
- No fw_cfg device;
- No ACPI table provided;
- Only minimal device tree nodes.

Quoted 5 lines

Can you describe why we actually need/want this? The virt machine already covers a lot of this and OSes and Hypervisors can pretty easily target that. I'm not clear what this buys us in QEMU. Maintaing a machine isn't that hard, but it would be nice to have a good reason to support it.

Quoted 4 lines

I'm late to the discussions but following up what Leif and Peter already
commented: this is a similar use case as ARM's sbsa-ref machine. It is a development focused board that adheres to a reference spec, it is not a board to be used for overall consumption - for that we have 'virt'.

That is all good information to add to the documentation :)

Quoted 5 lines

If the reference spec changes the emulation will follow suit, and existing software that was working previously can stop working. The assumption made here is that, when a spec change happens, developers must strive to make the SW work on the updated spec/reference machine.

I'm not sure people will like that though. If you are mid-way through making hardware to target v1.0 and v2.0 comes out you don't expect QEMU to update and break your entire setup.

But no one is going to expect to migrate, so we could just add a new machine when v2.0 comes out. So hopefully it isn't too much of a hassle

Quoted 3 lines

Last but not the least, this design decision also spare us from dealing with machine versioning.

Yep, seems fair

Alistair

#14 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

In reply to Alistair Francis

On Fri, May 01, 2026 at 01:27:41PM +1000, Alistair Francis wrote:
...

Quoted 9 lines
Quoted 1 line

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

The README should have said frozen instead of "everything may change". It was my fault for not having updated it. I have updated it now, though, but not to frozen, because v1.0 is now ratified.

Quoted 4 lines

So this machine needs to start out with version support (like the ARM virt board)

I'm happy to follow ARM's reference board's lead on this, at least for now. I only wonder if we may not want to use the QEMU machine versioning support to bind machine model versions to ratified and experimental platform specifications at some point. For example,

rv-server-ref -- new, bleeding edge platform implementation which
may include experimental bits
rv-server-ref-v1.0 -- versioning ensures the implementation matches v1.0
of the spec
rv-server-ref-v2.0 -- versioning ensures the implementation matches v2.0
of the spec - likely backward compatible with v1.0, but not necessarily

I'm not sure if [ab]using the QEMU machine versioning support in this way would cause confusion or other problems though.

Thanks,
drew

#15 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 34 lines · Andrew Jones

On Fri, May 01, 2026 at 01:27:41PM +1000, Alistair Francis wrote:
...

Quoted 9 lines
Quoted 1 line

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

The README should have said frozen instead of "everything may change". It was my fault for not having updated it. I have updated it now, though, but not to frozen, because v1.0 is now ratified.

Quoted 4 lines

So this machine needs to start out with version support (like the ARM virt board)

I'm happy to follow ARM's reference board's lead on this, at least for now. I only wonder if we may not want to use the QEMU machine versioning support to bind machine model versions to ratified and experimental platform specifications at some point. For example,

rv-server-ref -- new, bleeding edge platform implementation which
may include experimental bits
rv-server-ref-v1.0 -- versioning ensures the implementation matches v1.0
of the spec
rv-server-ref-v2.0 -- versioning ensures the implementation matches v2.0
of the spec - likely backward compatible with v1.0,
but not necessarily

Quoted 2 lines

I'm not sure if [ab]using the QEMU machine versioning support in this way would cause confusion or other problems though.

IMO we shouldn't use the QEMU machine versioning in this case. We can instantiate a new board in the same server_platform_ref.c file that has a different init(), memmaps and etc that would reflect the new spec. We can do that once every time a new major spec version is created (so ... once every 2+ years?) instead of having to cope with the all the compat_props machinery from the regular QEMU versioning design every single QEMU release.

Cheers,
Daniel

Quoted 3 lines

Thanks,
drew

#16 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 40 lines · Daniel Henrique Barboza
Quoted 34 lines · Andrew Jones

On Fri, May 01, 2026 at 01:27:41PM +1000, Alistair Francis wrote:
...

Quoted 9 lines
Quoted 1 line

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

The README should have said frozen instead of "everything may change". It was my fault for not having updated it. I have updated it now, though, but not to frozen, because v1.0 is now ratified.

Quoted 4 lines

So this machine needs to start out with version support (like the ARM virt board)

I'm happy to follow ARM's reference board's lead on this, at least for now. I only wonder if we may not want to use the QEMU machine versioning support to bind machine model versions to ratified and experimental platform specifications at some point. For example,

rv-server-ref -- new, bleeding edge platform implementation which
may include experimental bits
rv-server-ref-v1.0 -- versioning ensures the implementation matches v1.0
of the spec
rv-server-ref-v2.0 -- versioning ensures the implementation matches v2.0
of the spec - likely backward compatible with v1.0,
but not necessarily

Quoted 2 lines

I'm not sure if [ab]using the QEMU machine versioning support in this way would cause confusion or other problems though.

Quoted 8 lines

IMO we shouldn't use the QEMU machine versioning in this case. We can instantiate a new board in the same server_platform_ref.c file that has a different init(), memmaps and etc that would reflect the new spec. We can do that once every time a new major spec version is created (so ... once every 2+ years?) instead of having to cope with the all the compat_props machinery from the regular QEMU versioning design every single QEMU release.

Sounds good to me. And the rv-server-ref cpu models can do the same. We'll need to get the version number into the name, which means this series should name the board and cpu models something like rv-server-1-0-ref or whatever works best. I'm not sure if we just want to do this for major numbers, e.g. rv-server-v1-ref, it seems like someone may want to target a minor release.

Hmm, how about yet another idea. The name stays rv-server-ref, but then we have properties for each spec major.minor that get ratified. So, for starters, -machine rv-server-ref,spec_1_0=on and eventually we can also have -machine rv-server-ref,spec_1_1=on and
-machine rv-server-ref,spec_2_0=on. Without providing a property it would default to the latest ratified spec version.

Thanks,
drew

#17 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

Quoted 57 lines · Andrew Jones
Quoted 40 lines · Daniel Henrique Barboza
Quoted 34 lines · Andrew Jones

On Fri, May 01, 2026 at 01:27:41PM +1000, Alistair Francis wrote:
...

Quoted 9 lines
Quoted 1 line

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

The README should have said frozen instead of "everything may change". It was my fault for not having updated it. I have updated it now, though, but not to frozen, because v1.0 is now ratified.

Quoted 4 lines

So this machine needs to start out with version support (like the ARM virt board)

I'm happy to follow ARM's reference board's lead on this, at least for now. I only wonder if we may not want to use the QEMU machine versioning support to bind machine model versions to ratified and experimental platform specifications at some point. For example,

rv-server-ref -- new, bleeding edge platform implementation which
may include experimental bits
rv-server-ref-v1.0 -- versioning ensures the implementation matches v1.0
of the spec
rv-server-ref-v2.0 -- versioning ensures the implementation matches v2.0
of the spec - likely backward compatible with v1.0,
but not necessarily

Quoted 2 lines

I'm not sure if [ab]using the QEMU machine versioning support in this way would cause confusion or other problems though.

Quoted 8 lines

IMO we shouldn't use the QEMU machine versioning in this case. We can instantiate a new board in the same server_platform_ref.c file that has a different init(), memmaps and etc that would reflect the new spec. We can do that once every time a new major spec version is created (so ... once every 2+ years?) instead of having to cope with the all the compat_props machinery from the regular QEMU versioning design every single QEMU release.

Sounds good to me. And the rv-server-ref cpu models can do the same. We'll need to get the version number into the name, which means this series should name the board and cpu models something like rv-server-1-0-ref or whatever works best. I'm not sure if we just want to do this for major numbers, e.g. rv-server-v1-ref, it seems like someone may want to target a minor release.

Quoted 6 lines

Hmm, how about yet another idea. The name stays rv-server-ref, but then we have properties for each spec major.minor that get ratified. So, for starters, -machine rv-server-ref,spec_1_0=on and eventually we can also have -machine rv-server-ref,spec_1_1=on and
-machine rv-server-ref,spec_2_0=on. Without providing a property it would default to the latest ratified spec version.

Seems good to me too. For now let's leave the code as is since we're supporting just 1.0 and add the required boilerplate for these properties when we change the board to support a newer version.

Cheers,
Daniel

Quoted 3 lines

Thanks,
drew

#18 lore raw

Re: [PATCH v5 3/4] hw/riscv: server platform reference machine

In reply to Andrew Jones
Quoted 13 lines · Andrew Jones

On Fri, May 01, 2026 at 01:27:41PM +1000, Alistair Francis wrote:
...

Quoted 9 lines
Quoted 1 line

[1] https://github.com/riscv-non-isa/riscv-server-platform

The first line of the README says:

"""
This document is capturing discussions at the Server Platform TG. These are not official specifications and everything in this document may change.
"""

Quoted 3 lines

The README should have said frozen instead of "everything may change". It was my fault for not having updated it. I have updated it now, though, but not to frozen, because v1.0 is now ratified.

Thanks, this being ratified makes a big difference here

Alistair

Quoted 24 lines
Quoted 5 lines

So this machine needs to start out with version support (like the ARM virt board)

I'm happy to follow ARM's reference board's lead on this, at least for now. I only wonder if we may not want to use the QEMU machine versioning support to bind machine model versions to ratified and experimental platform specifications at some point. For example,

rv-server-ref -- new, bleeding edge platform implementation which
may include experimental bits
rv-server-ref-v1.0 -- versioning ensures the implementation matches v1.0
of the spec
rv-server-ref-v2.0 -- versioning ensures the implementation matches v2.0
of the spec - likely backward compatible with v1.0, but not necessarily

I'm not sure if [ab]using the QEMU machine versioning support in this way would cause confusion or other problems though.

Thanks,
drew

#19 lore raw

PATCH v5 4/4 docs: add riscv-server-ref.rst

In reply to Daniel Henrique Barboza

Add documentation for the new riscv-server-ref board.

---
 docs/system/riscv/riscv-server-ref.rst | 31 ++++++++++++++++++++++++++
 docs/system/target-riscv.rst           |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 docs/system/riscv/riscv-server-ref.rst
docs/system/riscv/riscv-server-ref.rst new file +31 -0
new file mode 100644
index 0000000000..acf7110b96
@@ -0,0 +1,31 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+RISC-V Server Platform Reference board (``riscv-server-ref``)
+=============================================================
+
+The RISC-V Server Platform specification `spec`_ defines a standardized
+set of hardware and software capabilities that portable system software,
+such as OS and hypervisors, can rely on being present in a RISC-V server
+platform.  This machine aims to emulate this specification, providing
+an environment for firmware/OS development and testing.
+
+The main features included in the riscv-server-ref board are:
+
+* IOMMU platform device (riscv-iommu-sys)
+* AIA
+* PCIe AHCI
+* PCIe NIC
+* No virtio mmio bus
+* No fw_cfg device
+* No ACPI table
+* Minimal device tree nodes
+
+There are multiple ways of using this reference board, some of them being:
+
+* BIOS: u-boot-spl.bin; SD-CARD: <disk_containing_FIT>; NVME: <distro_disk>
+* BIOS: fw_dynamic.bin; KERNEL: u-boot.bin; NVME: <distro_disk>
+* BIOS: fw_dynamic.bin; KERNEL: EDK2.fd; NVME: <distro_disk>
+* BIOS: fw_dynamic.bin; KERNEL: <linux_image>; INITRD: <busybox_initrd>
+
+
+.. _spec: https://github.com/riscv-non-isa/riscv-server-platform
docs/system/target-riscv.rst +1 -0
index 3ad5d1ddaf..3f7690331b 100644
@@ -73,6 +73,7 @@ undocumented; you can get a complete list by running
    riscv/sifive_u
    riscv/virt
    riscv/xiangshan-kunminghu
+   riscv/riscv-server-ref
 
 RISC-V CPU firmware
 -------------------
Signature · 1 line
2.43.0