Skip to contentSkip to conversation

hw/riscv: Add Server Platform Reference Board

PATCH Superseded Daniel Henrique Barboza 5 participants 20 messages May 28, 2025 – Oct 30, 2025

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover hw/riscv: Add Server Platform Reference Board

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].

Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

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

Changes from v2:
- patch 1 (new):
- allow CPUs other than 'bare' to assign profiles
- patch 2 (former 1):
- added RVA23 profile support in the rvsp-ref CPU
- patch 3 (former 2):
- hw/riscv/Kconfig changes:
* added 'default y' in hw/riscv/Kconfig to build the board by default
* added 'depends on RISCV64' to prevent the board to be built for qemu-system-riscv32

- HMP qtest fixes:
* added rvsp_aclint_allowed(). Use it instead of (!tcg_enabled()) when checking aclint support

- changes in rvsp_ref_machine_done():
* added 'RISCVBootInfo boot_info' struct
* changed riscv_find_and_load_firmware(), riscv_calc_kernel_start_addr(), riscv_load_kernel() and riscv_compute_fdt_addr() to use boot_info

- added "hw/char/serial-mm.h" include
- changed 'addr' mem variables to 'hwaddr'
- use HWADDR_PRIx format with 'addr' variables
- changed GPEX_NUM_IRQS to PCI_NUM_PINS

- patch 4 (new):
- add riscv-iommu-sys platform device
- v2 link: https://lore.kernel.org/qemu-riscv/[email protected]/

[1] https://lore.kernel.org/qemu-riscv/[email protected]/
[2] https://lore.kernel.org/qemu-riscv/CAHBxVyG186Zo7nAm7o8=vhBtzU+x8ry4_mWwHxuaZ8BasnDyPg@mail.gmail.com/

Daniel Henrique Barboza (2):
target/riscv/cpu.c: remove 'bare' condition for .profile hw/riscv/server_platform_ref.c: add riscv-iommu-sys

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

 configs/devices/riscv64-softmmu/default.mak |    1 +
 hw/riscv/Kconfig                            |   15 +
 hw/riscv/meson.build                        |    1 +
 hw/riscv/server_platform_ref.c              | 1346 +++++++++++++++++++
 target/riscv/cpu-qom.h                      |    1 +
 target/riscv/cpu.c                          |   12 +-
 6 files changed, 1375 insertions(+), 1 deletion(-)
 create mode 100644 hw/riscv/server_platform_ref.c
Signature · 1 line
2.49.0
#1 lore raw

PATCH v3 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 fe21e0fb44..4a30cf8444 100644
@@ -2713,7 +2713,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.49.0
Reviewed-by on v3 1/4
#2 lore raw

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

Quoted 28 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.

---
 target/riscv/cpu.c | 1 -
 1 file changed, 1 deletion(-)
target/riscv/cpu.c +0 -1
index fe21e0fb44..4a30cf8444 100644
@@ -2713,7 +2713,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.49.0
#3 lore raw

PATCH v3 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, plus Sv48, Svadu, H, Sscofmpf etc. This patch provides a virt CPU type (rvsp-ref) as compliant as possible.

[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 1ee05eb393..70978fd53c 100644
@@ -55,6 +55,7 @@
 #define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
 #define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
 #define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
+#define TYPE_RISCV_CPU_RVSP_REF         RISCV_CPU_TYPE_NAME("rvsp-ref")
 #define TYPE_RISCV_CPU_HOST             RISCV_CPU_TYPE_NAME("host")
 
 OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
target/riscv/cpu.c +11 -0
index 4a30cf8444..ec2fbc0e78 100644
@@ -3166,6 +3166,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
         .cfg.max_satp_mode = VM_1_10_SV39,
     ),
 
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSP_REF, TYPE_RISCV_VENDOR_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        /* ISA extensions */
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = 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.49.0
#4 lore raw

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

Quoted 34 lines · Daniel Henrique Barboza

From: Fei Wu <[email protected]>

The harts requirements of RISC-V server platform [1] require RVA23 ISA profile support, plus Sv48, Svadu, H, Sscofmpf etc. This patch provides a virt CPU type (rvsp-ref) as compliant as possible.

[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 1ee05eb393..70978fd53c 100644
@@ -55,6 +55,7 @@
 #define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
 #define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
 #define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
+#define TYPE_RISCV_CPU_RVSP_REF         RISCV_CPU_TYPE_NAME("rvsp-ref")
 #define TYPE_RISCV_CPU_HOST             RISCV_CPU_TYPE_NAME("host")
 
 OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
target/riscv/cpu.c +0 -0
index 4a30cf8444..ec2fbc0e78 100644
@@ -3166,6 +3166,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
         .cfg.max_satp_mode = VM_1_10_SV39,
     ),

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

Quoted 10 lines
target/riscv/cpu.c +9 -0
 
+    DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSP_REF, TYPE_RISCV_VENDOR_CPU,
+        .misa_mxl_max = MXL_RV64,
+        .profile = &RVA23S64,
+
+        /* ISA extensions */
+        .cfg.ext_zkr = true,
+        .cfg.ext_svadu = true,
+
+        .cfg.max_satp_mode = VM_1_10_SV57,

This is still missing several extensions required by the platform spec.

Sdtrig
Sdext
Ssccfg
Ssstrict
Ssaia

Thanks,
drew

Quoted 8 lines
target/riscv/cpu.c +2 -0
+    ),
+
 #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.49.0
#5 lore raw

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

In reply to Daniel Henrique Barboza
Quoted 31 lines · Daniel Henrique Barboza

rom: Fei Wu <[email protected]>

he harts requirements of RISC-V server platform [1] require RVA23 ISA rofile support, plus Sv48, Svadu, H, Sscofmpf etc. This patch provides virt CPU type (rvsp-ref) as compliant as possible.

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(+)

iff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h ndex 1ee05eb393..70978fd53c 100644
-- a/target/riscv/cpu-qom.h
++ b/target/riscv/cpu-qom.h
@ -55,6 +55,7 @@

#define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
#define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
#define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
#define TYPE_RISCV_CPU_RVSP_REF         RISCV_CPU_TYPE_NAME("rvsp-ref")
#define TYPE_RISCV_CPU_HOST             RISCV_CPU_TYPE_NAME("host")

OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU) iff --git a/target/riscv/cpu.c b/target/riscv/cpu.c ndex 4a30cf8444..ec2fbc0e78 100644
-- a/target/riscv/cpu.c
++ b/target/riscv/cpu.c

Quoted 5 lines
@ -3166,6 +3166,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
       .cfg.max_satp_mode = VM_1_10_SV39,

),

DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSP_REF, TYPE_RISCV_VENDOR_CPU,

I'm not sure the parent type TYPE_RISCV_VENDOR_CPU is right here.

To be on the safe side, I tested this CPU type using an openEuler image that can boot on a virtual machine. This image supports rva23s64, and my command is as follows:

cmd="$QEMU_SYSTEM_RISCV64 \
-nographic -machine virt,pflash0=pflash0,pflash1=pflash1,acpi=off \
-cpu rvsp-ref \
-smp "$vcpu" -m "$memory"G \
-blockdev node-name=pflash0,driver=file,read-only=on,filename="$fw1" \
-blockdev node-name=pflash1,driver=file,filename="$fw2" \
-drive file="$drive",format=qcow2,id=hd0,if=none \
-object rng-random,filename=/dev/urandom,id=rng0 \
-device virtio-vga \
-device virtio-rng-device,rng=rng0 \
-device virtio-blk-device,drive=hd0 \
-device virtio-net-device,netdev=usernet \
-netdev user,id=usernet,hostfwd=tcp::"$ssh_port"-:22 \
-device qemu-xhci -usb -device usb-kbd -device usb-tablet"

This process gets stuck at the initialization stage:

```
    Loading Linux 6.6.0-102.0.0.5.oe2509.riscv64 ...
    Loading initial ramdisk ...
```

If I use the parameter -cpu rva23s64, the system can boot normally.

I tried changing TYPE_RISCV_VENDOR_CPU to TYPE_RISCV_BARE_CPU and found that the system then boots normally.

However, I haven’t conducted an in-depth analysis yet, so the issue might be with my system image.

Thanks,
Chao

Quoted 10 lines
       .misa_mxl_max = MXL_RV64,
       .profile = &RVA23S64,

       /* ISA extensions */
       .cfg.ext_zkr = true,
       .cfg.ext_svadu = true,

       .cfg.max_satp_mode = VM_1_10_SV57,

),

#6 lore raw

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

Quoted 66 lines · Chao Liu
Quoted 36 lines · Daniel Henrique Barboza

rom: Fei Wu <[email protected]>

he harts requirements of RISC-V server platform [1] require RVA23 ISA rofile support, plus Sv48, Svadu, H, Sscofmpf etc. This patch provides virt CPU type (rvsp-ref) as compliant as possible.

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

Signature · 25 lines
target/riscv/cpu-qom.h |  1 +
target/riscv/cpu.c     | 11 +++++++++++
2 files changed, 12 insertions(+)

iff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
ndex 1ee05eb393..70978fd53c 100644
-- a/target/riscv/cpu-qom.h
++ b/target/riscv/cpu-qom.h
@ -55,6 +55,7 @@
#define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
#define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
#define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
#define TYPE_RISCV_CPU_RVSP_REF         RISCV_CPU_TYPE_NAME("rvsp-ref")
#define TYPE_RISCV_CPU_HOST             RISCV_CPU_TYPE_NAME("host")

OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
iff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
ndex 4a30cf8444..ec2fbc0e78 100644
-- a/target/riscv/cpu.c
++ b/target/riscv/cpu.c
@ -3166,6 +3166,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
       .cfg.max_satp_mode = VM_1_10_SV39,
   ),

   DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSP_REF, TYPE_RISCV_VENDOR_CPU,

I'm not sure the parent type TYPE_RISCV_VENDOR_CPU is right here.

To be on the safe side, I tested this CPU type using an openEuler image that can boot on a virtual machine. This image supports rva23s64, and my command is as follows:

cmd="$QEMU_SYSTEM_RISCV64 \
  -nographic -machine virt,pflash0=pflash0,pflash1=pflash1,acpi=off \
  -cpu rvsp-ref \
  -smp "$vcpu" -m "$memory"G \
  -blockdev node-name=pflash0,driver=file,read-only=on,filename="$fw1" \
  -blockdev node-name=pflash1,driver=file,filename="$fw2" \
  -drive file="$drive",format=qcow2,id=hd0,if=none \
  -object rng-random,filename=/dev/urandom,id=rng0 \
  -device virtio-vga \
  -device virtio-rng-device,rng=rng0 \
  -device virtio-blk-device,drive=hd0 \
  -device virtio-net-device,netdev=usernet \
  -netdev user,id=usernet,hostfwd=tcp::"$ssh_port"-:22 \
  -device qemu-xhci -usb -device usb-kbd -device usb-tablet"

This process gets stuck at the initialization stage:

```
     Loading Linux 6.6.0-102.0.0.5.oe2509.riscv64 ...
     Loading initial ramdisk ...
```
Quoted 4 lines

If I use the parameter -cpu rva23s64, the system can boot normally.

I tried changing TYPE_RISCV_VENDOR_CPU to TYPE_RISCV_BARE_CPU and found that the system then boots normally.

There is a chance that we're mishandling the .profile property with VENDOR type CPUs. Maybe worth taking a look.

There's nothing stopping us from declaring the CPU as BARE though. It's probably a good idea - it gives us a clean CPU without any enabled default extensions to work on. I believe we can change that for v4.

Thanks,

Daniel

Quoted 18 lines

However, I haven’t conducted an in-depth analysis yet, so the issue might be with my system image.

Thanks,
Chao

Quoted 10 lines

       .misa_mxl_max = MXL_RV64,
       .profile = &RVA23S64,

       /* ISA extensions */
       .cfg.ext_zkr = true,
       .cfg.ext_svadu = true,

       .cfg.max_satp_mode = VM_1_10_SV57,
   ),

#7 lore raw

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

Quoted 74 lines · Daniel Henrique Barboza
Quoted 66 lines · Chao Liu
Quoted 36 lines · Daniel Henrique Barboza

rom: Fei Wu <[email protected]>

he harts requirements of RISC-V server platform [1] require RVA23 ISA rofile support, plus Sv48, Svadu, H, Sscofmpf etc. This patch provides virt CPU type (rvsp-ref) as compliant as possible.

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

Signature · 25 lines
target/riscv/cpu-qom.h |  1 +
target/riscv/cpu.c     | 11 +++++++++++
2 files changed, 12 insertions(+)

iff --git a/target/riscv/cpu-qom.h b/target/riscv/cpu-qom.h
ndex 1ee05eb393..70978fd53c 100644
-- a/target/riscv/cpu-qom.h
++ b/target/riscv/cpu-qom.h
@ -55,6 +55,7 @@
#define TYPE_RISCV_CPU_VEYRON_V1        RISCV_CPU_TYPE_NAME("veyron-v1")
#define TYPE_RISCV_CPU_TT_ASCALON       RISCV_CPU_TYPE_NAME("tt-ascalon")
#define TYPE_RISCV_CPU_XIANGSHAN_NANHU  RISCV_CPU_TYPE_NAME("xiangshan-nanhu")
#define TYPE_RISCV_CPU_RVSP_REF         RISCV_CPU_TYPE_NAME("rvsp-ref")
#define TYPE_RISCV_CPU_HOST             RISCV_CPU_TYPE_NAME("host")

OBJECT_DECLARE_CPU_TYPE(RISCVCPU, RISCVCPUClass, RISCV_CPU)
iff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
ndex 4a30cf8444..ec2fbc0e78 100644
-- a/target/riscv/cpu.c
++ b/target/riscv/cpu.c
@ -3166,6 +3166,17 @@ static const TypeInfo riscv_cpu_type_infos[] = {
       .cfg.max_satp_mode = VM_1_10_SV39,
   ),

   DEFINE_RISCV_CPU(TYPE_RISCV_CPU_RVSP_REF, TYPE_RISCV_VENDOR_CPU,

I'm not sure the parent type TYPE_RISCV_VENDOR_CPU is right here.

To be on the safe side, I tested this CPU type using an openEuler image that can boot on a virtual machine. This image supports rva23s64, and my command is as follows:

cmd="$QEMU_SYSTEM_RISCV64 \
   -nographic -machine virt,pflash0=pflash0,pflash1=pflash1,acpi=off \
   -cpu rvsp-ref \
   -smp "$vcpu" -m "$memory"G \
   -blockdev node-name=pflash0,driver=file,read-only=on,filename="$fw1" \
   -blockdev node-name=pflash1,driver=file,filename="$fw2" \
   -drive file="$drive",format=qcow2,id=hd0,if=none \
   -object rng-random,filename=/dev/urandom,id=rng0 \
   -device virtio-vga \
   -device virtio-rng-device,rng=rng0 \
   -device virtio-blk-device,drive=hd0 \
   -device virtio-net-device,netdev=usernet \
   -netdev user,id=usernet,hostfwd=tcp::"$ssh_port"-:22 \
   -device qemu-xhci -usb -device usb-kbd -device usb-tablet"

This process gets stuck at the initialization stage:

```
     Loading Linux 6.6.0-102.0.0.5.oe2509.riscv64 ...
     Loading initial ramdisk ...
```
Quoted 4 lines

If I use the parameter -cpu rva23s64, the system can boot normally.

I tried changing TYPE_RISCV_VENDOR_CPU to TYPE_RISCV_BARE_CPU and found that the system then boots normally.

Quoted 7 lines

There is a chance that we're mishandling the .profile property with VENDOR type CPUs. Maybe worth taking a look.

There's nothing stopping us from declaring the CPU as BARE though. It's probably a good idea - it gives us a clean CPU without any enabled default extensions to work on. I believe we can change that for v4.

I have done more tests. TYPE_RISCV_BARE_CPU works well in the virt machine, but it can’t start EDKII normally in the rvsp-ref machine.

I think it’s really worth finding out the exact reason first before we decide whether to make the change.

If I get any progress on my part, I will reply to this email quickly :).

Thanks,
Chao

#8 lore raw

PATCH v3 3/4 hw/riscv: Add 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.

A corresponding Qemu RISC-V server platform reference (rvsp-ref for short) machine type is added to provide a environment for firmware/OS development and testing. The main features included in rvsp-ref are:

- Based on riscv virt machine type
- A new memory map as close as virt machine as possible
- A new virt CPU type rvsp-ref-cpu for server platform compliance
- 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                            |   14 +
 hw/riscv/meson.build                        |    1 +
 hw/riscv/server_platform_ref.c              | 1276 +++++++++++++++++++
 4 files changed, 1292 insertions(+)
 create mode 100644 hw/riscv/server_platform_ref.c
configs/devices/riscv64-softmmu/default.mak +1 -0
index 39ed3a0061..0c4893b708 100644
@@ -9,5 +9,6 @@
 # CONFIG_SIFIVE_E=n
 # CONFIG_SIFIVE_U=n
 # CONFIG_RISCV_VIRT=n
+# CONFIG_SERVER_PLATFORM_REF=n
 # CONFIG_MICROCHIP_PFSOC=n
 # CONFIG_SHAKTI_C=n
hw/riscv/Kconfig +14 -0
index e6a0ac1fa1..f626774c52 100644
@@ -69,6 +69,20 @@ config RISCV_VIRT
     select ACPI
     select ACPI_PCI
 
+config 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
+
 config SHAKTI_C
     bool
     default y
hw/riscv/meson.build +1 -0
index c22f3a7216..7a663fac64 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_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 +1276 -0

1,276 lines not on this page · raw message

Signature · 1 line
2.49.0
#9 lore raw

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

Quoted 11 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.

A corresponding Qemu RISC-V server platform reference (rvsp-ref for short) machine type is added to provide a environment for firmware/OS development and testing. The main features included in rvsp-ref are:

Quoted 10 lines

- Based on riscv virt machine type
- A new memory map as close as virt machine as possible
- A new virt CPU type rvsp-ref-cpu for server platform compliance
- AIA
- PCIe AHCI
- PCIe NIC
- No virtio device
- No fw_cfg device
- No ACPI table provided
- Only minimal device tree nodes

The server platform spec requires BRS-I (see FIRM_010). BRS-I requires ACPI, and even some specific ACPI tables, e.g. PPTT (see Chapter 6 of the BRS spec). However, I think the idea is we're suppose to generate a DT here and then leave it to edk2 to generate ACPI tables from that DT.

Quoted 33 lines

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

---
 configs/devices/riscv64-softmmu/default.mak |    1 +
 hw/riscv/Kconfig                            |   14 +
 hw/riscv/meson.build                        |    1 +
 hw/riscv/server_platform_ref.c              | 1276 +++++++++++++++++++
 4 files changed, 1292 insertions(+)
 create mode 100644 hw/riscv/server_platform_ref.c
configs/devices/riscv64-softmmu/default.mak +1 -0
index 39ed3a0061..0c4893b708 100644
@@ -9,5 +9,6 @@
 # CONFIG_SIFIVE_E=n
 # CONFIG_SIFIVE_U=n
 # CONFIG_RISCV_VIRT=n
+# CONFIG_SERVER_PLATFORM_REF=n
 # CONFIG_MICROCHIP_PFSOC=n
 # CONFIG_SHAKTI_C=n
hw/riscv/Kconfig +1 -0
index e6a0ac1fa1..f626774c52 100644
@@ -69,6 +69,20 @@ config RISCV_VIRT
     select ACPI
     select ACPI_PCI
 
+config SERVER_PLATFORM_REF

hw/riscv/Kconfig config RISCV_VIRT · line 82

Quoted 10 lines
hw/riscv/Kconfig +10 -0
+    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

We shouldn't need ACLINT.

hw/riscv/server_platform_ref.c

Quoted 24 lines
hw/riscv/Kconfig +3 -0
+    select RISCV_APLIC
+    select RISCV_IMSIC
+
 config SHAKTI_C
     bool
     default y
hw/riscv/meson.build +1 -0
index c22f3a7216..7a663fac64 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_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 +0 -0
new file mode 100644
index 0000000000..5102286103
@@ -0,0 +1,1276 @@

Missing SPDX

hw/riscv/server_platform_ref.c line 8

Quoted 8 lines
hw/riscv/server_platform_ref.c new file +8 -0
+/*
+ * QEMU RISC-V Server Platform (RVSP) Reference Board
+ *
+ * Copyright (c) 2024 Intel, Inc.
+ * Copyright (c) 2025 Ventana Micro Systems Inc.
+ *
+ * This board is compliant RISC-V Server platform specification and leveraging
+ * a lot of riscv virt code.

This board provides a reference implementation of the RISC-V Server Platform specification.

hw/riscv/server_platform_ref.c line 11

Quoted 3 lines
hw/riscv/server_platform_ref.c new file +3 -0
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.

Can be dropped, since we want SPDX instead.

Quoted 51 lines
hw/riscv/server_platform_ref.c new file +51 -0
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/units.h"
+#include "qemu/error-report.h"
+#include "qemu/guest-random.h"
+#include "qapi/error.h"
+#include "qapi/qapi-visit-common.h"
+#include "hw/boards.h"
+#include "hw/loader.h"
+#include "hw/sysbus.h"
+#include "hw/qdev-properties.h"
+#include "hw/char/serial.h"
+#include "hw/block/flash.h"
+#include "hw/ide/pci.h"
+#include "hw/ide/ahci-pci.h"
+#include "hw/pci/pci.h"
+#include "hw/pci-host/gpex.h"
+#include "hw/core/sysbus-fdt.h"
+#include "hw/riscv/riscv_hart.h"
+#include "hw/riscv/boot.h"
+#include "hw/riscv/numa.h"
+#include "hw/intc/riscv_aclint.h"
+#include "hw/intc/riscv_aplic.h"
+#include "hw/intc/riscv_imsic.h"
+#include "chardev/char.h"
+#include "hw/char/serial-mm.h"
+#include "system/device_tree.h"
+#include "system/runstate.h"
+#include "system/system.h"
+#include "system/tcg.h"
+#include "system/qtest.h"
+#include "target/riscv/cpu.h"
+#include "target/riscv/pmu.h"
+#include "net/net.h"
+
+#define RVSP_CPUS_MAX_BITS             9
+#define RVSP_CPUS_MAX                  (1 << RVSP_CPUS_MAX_BITS)
+#define RVSP_SOCKETS_MAX_BITS          2
+#define RVSP_SOCKETS_MAX               (1 << RVSP_SOCKETS_MAX_BITS)
+
+#define RVSP_IRQCHIP_NUM_MSIS 255
+#define RVSP_IRQCHIP_NUM_SOURCES 96
+#define RVSP_IRQCHIP_NUM_PRIO_BITS 3
+#define RVSP_IRQCHIP_MAX_GUESTS_BITS 3
+#define RVSP_IRQCHIP_MAX_GUESTS ((1U << RVSP_IRQCHIP_MAX_GUESTS_BITS) - 1U)
+
+#define FDT_PCI_ADDR_CELLS    3
+#define FDT_PCI_INT_CELLS     1
+#define FDT_APLIC_INT_CELLS   2
+#define FDT_IMSIC_INT_CELLS   0

hw/riscv/server_platform_ref.c line 72

Quoted 10 lines
hw/riscv/server_platform_ref.c new file +10 -0
+#define FDT_MAX_INT_CELLS     2
+#define FDT_MAX_INT_MAP_WIDTH (FDT_PCI_ADDR_CELLS + FDT_PCI_INT_CELLS + \
+                                 1 + FDT_MAX_INT_CELLS)
+#define FDT_APLIC_INT_MAP_WIDTH (FDT_PCI_ADDR_CELLS + FDT_PCI_INT_CELLS + \
+                                 1 + FDT_APLIC_INT_CELLS)
+
+#define NUM_SATA_PORTS  6
+
+#define SYSCON_RESET     0x1
+#define SYSCON_POWEROFF  0x2

nit: should align all the above defines

Quoted 6 lines
hw/riscv/server_platform_ref.c new file +6 -0
+
+#define TYPE_RVSP_REF_MACHINE MACHINE_TYPE_NAME("rvsp-ref")
+OBJECT_DECLARE_SIMPLE_TYPE(RVSPMachineState, RVSP_REF_MACHINE)
+
+struct RVSPMachineState {
+    /*< private >*/

hw/riscv/server_platform_ref.c line 88

Quoted 10 lines
hw/riscv/server_platform_ref.c new file +10 -0
+    MachineState parent;
+
+    /*< public >*/
+    Notifier machine_done;
+    RISCVHartArrayState soc[RVSP_SOCKETS_MAX];
+    DeviceState *irqchip[RVSP_SOCKETS_MAX];
+    PFlashCFI01 *flash[2];
+
+    int fdt_size;
+    int aia_guests;

This can be hard coded to 5, as required by the server-soc spec.

Thanks,
drew

#10 lore raw

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

In reply to Daniel Henrique Barboza
Quoted 50 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.

A corresponding Qemu RISC-V server platform reference (rvsp-ref for short) machine type is added to provide a environment for firmware/OS development and testing. The main features included in rvsp-ref are:

- Based on riscv virt machine type
- A new memory map as close as virt machine as possible
- A new virt CPU type rvsp-ref-cpu for server platform compliance
- 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                            |   14 +
  hw/riscv/meson.build                        |    1 +
  hw/riscv/server_platform_ref.c              | 1276 +++++++++++++++++++
  4 files changed, 1292 insertions(+)

create mode 100644 hw/riscv/server_platform_ref.c

configs/devices/riscv64-softmmu/default.mak +1 -0
index 39ed3a0061..0c4893b708 100644
@@ -9,5 +9,6 @@
  # CONFIG_SIFIVE_E=n
  # CONFIG_SIFIVE_U=n
  # CONFIG_RISCV_VIRT=n
+# CONFIG_SERVER_PLATFORM_REF=n
  # CONFIG_MICROCHIP_PFSOC=n
  # CONFIG_SHAKTI_C=n
hw/riscv/Kconfig +0 -0
index e6a0ac1fa1..f626774c52 100644

hw/riscv/Kconfig config RISCV_VIRT · line 78

Quoted 10 lines
hw/riscv/Kconfig +7 -0
@@ -69,6 +69,20 @@ config RISCV_VIRT
      select ACPI
      select ACPI_PCI
 
+config SERVER_PLATFORM_REF
+    bool
+    default y
+    depends on RISCV64
+    select RISCV_NUMA
+    select GOLDFISH_RTC
+    select PCI

PCI is already selected by PCI_EXPRESS_GENERIC_BRIDGE.

Quoted 6 lines
hw/riscv/Kconfig +6 -0
+    select PCI_EXPRESS_GENERIC_BRIDGE
+    select PFLASH_CFI01
+    select SERIAL
+    select RISCV_ACLINT
+    select RISCV_APLIC
+    select RISCV_IMSIC
#11 lore raw

PATCH v3 4/4 hw/riscv/server_platform_ref.c: add riscv-iommu-sys

In reply to Daniel Henrique Barboza

Add an always present IOMMU platform device for the rvsp-ref board.

The IRQs being used are similar to what the 'virt' board is using: IRQs 36 to 39, one IRQ for queue.

---
 hw/riscv/Kconfig               |  1 +
 hw/riscv/server_platform_ref.c | 78 ++++++++++++++++++++++++++++++++--
 2 files changed, 75 insertions(+), 4 deletions(-)
hw/riscv/Kconfig +1 -0
index f626774c52..cd70095687 100644
@@ -82,6 +82,7 @@ config SERVER_PLATFORM_REF
     select RISCV_ACLINT
     select RISCV_APLIC
     select RISCV_IMSIC
+    select RISCV_IOMMU
 
 config SHAKTI_C
     bool
hw/riscv/server_platform_ref.c +74 -4

138 lines not on this page · raw message

Signature · 1 line
2.49.0
Reviewed-by on v3 4/4
#12 lore raw

Re: [PATCH v3 4/4] hw/riscv/server_platform_ref.c: add riscv-iommu-sys

Quoted 11 lines · Daniel Henrique Barboza

Add an always present IOMMU platform device for the rvsp-ref board.

The IRQs being used are similar to what the 'virt' board is using: IRQs 36 to 39, one IRQ for queue.

---
 hw/riscv/Kconfig               |  1 +
 hw/riscv/server_platform_ref.c | 78 ++++++++++++++++++++++++++++++++--
 2 files changed, 75 insertions(+), 4 deletions(-)
#13 lore raw

Re: [PATCH v3 4/4] hw/riscv/server_platform_ref.c: add riscv-iommu-sys

In reply to Daniel Henrique Barboza
Quoted 53 lines · Daniel Henrique Barboza

Add an always present IOMMU platform device for the rvsp-ref board.

The IRQs being used are similar to what the 'virt' board is using: IRQs 36 to 39, one IRQ for queue.

---
hw/riscv/Kconfig | 1 +
hw/riscv/server_platform_ref.c | 78 ++++++++++++++++++++++++++++++++--

2 files changed, 75 insertions(+), 4 deletions(-)
hw/riscv/Kconfig +1 -0
index f626774c52..cd70095687 100644
@@ -82,6 +82,7 @@ config SERVER_PLATFORM_REF
    select RISCV_ACLINT
    select RISCV_APLIC
    select RISCV_IMSIC
+    select RISCV_IOMMU
 

config SHAKTI_C
bool

hw/riscv/server_platform_ref.c +4 -0
index 5102286103..9740b395f6 100644
@@ -31,6 +31,8 @@
 #include "hw/riscv/riscv_hart.h"
 #include "hw/riscv/boot.h"
 #include "hw/riscv/numa.h"
+#include "hw/riscv/iommu.h"
+#include "hw/riscv/riscv-iommu-bits.h"
 #include "hw/intc/riscv_aclint.h"
 #include "hw/intc/riscv_aplic.h"
 #include "hw/intc/riscv_imsic.h"
@@ -94,6 +96,7 @@ enum {
    RVSP_MROM,
    RVSP_RESET_SYSCON,
    RVSP_RTC,
+    RVSP_IOMMU_SYS,
    RVSP_ACLINT,
    RVSP_APLIC_M,
    RVSP_APLIC_S,
@@ -112,6 +115,7 @@ enum {
    RVSP_UART0_IRQ = 10,
    RVSP_RTC_IRQ = 11,
    RVSP_PCIE_IRQ = 0x20, /* 32 to 35 */
+    IOMMU_SYS_IRQ = 0x24 /* 36 to 39 */
 };
 
 /*

hw/riscv/server_platform_ref.c static const MemMapEntry rvsp_ref_memmap[] = { · line 148

Quoted 4 lines
hw/riscv/server_platform_ref.c +1 -0
@@ -141,6 +145,7 @@ static const MemMapEntry rvsp_ref_memmap[] = {
    [RVSP_MROM] =           {     0x1000,        0xf000 },
    [RVSP_RESET_SYSCON] =   {   0x100000,        0x1000 },
    [RVSP_RTC] =            {   0x101000,        0x1000 },
+    [RVSP_IOMMU_SYS] =      {    0102000,        0x1000 },

This might be a typo:

     0102000 -> 0x102000

Thanks,
Chao

#14 lore raw

Re: [PATCH v3 4/4] hw/riscv/server_platform_ref.c: add riscv-iommu-sys

Quoted 52 lines · Chao Liu
Quoted 51 lines · Daniel Henrique Barboza

Add an always present IOMMU platform device for the rvsp-ref board.

The IRQs being used are similar to what the 'virt' board is using: IRQs 36 to 39, one IRQ for queue.

---
hw/riscv/Kconfig               |  1 + hw/riscv/server_platform_ref.c | 78 ++++++++++++++++++++++++++++++++--

2 files changed, 75 insertions(+), 4 deletions(-)
hw/riscv/Kconfig +0 -0
index f626774c52..cd70095687 100644
@@ -82,6 +82,7 @@ config SERVER_PLATFORM_REF

    select RISCV_ACLINT
    select RISCV_APLIC
    select RISCV_IMSIC
+    select RISCV_IOMMU

config SHAKTI_C
    bool

hw/riscv/server_platform_ref.c +3 -0
index 5102286103..9740b395f6 100644
@@ -31,6 +31,8 @@
 #include "hw/riscv/riscv_hart.h"
 #include "hw/riscv/boot.h"
 #include "hw/riscv/numa.h"
+#include "hw/riscv/iommu.h"
+#include "hw/riscv/riscv-iommu-bits.h"
 #include "hw/intc/riscv_aclint.h"
 #include "hw/intc/riscv_aplic.h"
 #include "hw/intc/riscv_imsic.h"
@@ -94,6 +96,7 @@ enum {
     RVSP_MROM,
     RVSP_RESET_SYSCON,
     RVSP_RTC,
+    RVSP_IOMMU_SYS,
     RVSP_ACLINT,
     RVSP_APLIC_M,
     RVSP_APLIC_S,
@@ -112,6 +115,7 @@ enum {
     RVSP_UART0_IRQ = 10,
     RVSP_RTC_IRQ = 11,

    RVSP_PCIE_IRQ = 0x20, /* 32 to 35 */
+    IOMMU_SYS_IRQ = 0x24 /* 36 to 39 */
};

Quoted 8 lines

hw/riscv/server_platform_ref.c static const MemMapEntry rvsp_ref_memmap[] = { · line 148

Quoted 6 lines

/*

hw/riscv/server_platform_ref.c +1 -0
@@ -141,6 +145,7 @@ static const MemMapEntry rvsp_ref_memmap[] = {
     [RVSP_MROM] =           {     0x1000,        0xf000 },
     [RVSP_RESET_SYSCON] =   {   0x100000,        0x1000 },
     [RVSP_RTC] =            {   0x101000,        0x1000 },
+    [RVSP_IOMMU_SYS] =      {    0102000,        0x1000 },

This might be a typo:
     0102000 -> 0x102000

Good call. I'll fix it in v4. Thanks,

Daniel

Quoted 4 lines

Thanks,
Chao

#15 lore raw
In reply to Daniel Henrique Barboza
Quoted 21 lines · Daniel Henrique Barboza

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].

Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Quoted 3 lines

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

Hi, Daniel.

Do we have any plans to support virt-io on the rvsp-ref machine in the future?

Recently, I have been using the RISC-V reference platform built on this set of patches to support running the OpenEuler RISC-V operating system.

I will actively feed back any test results to the upstream.

Thanks,
Chao

#16 lore raw
Quoted 21 lines · Chao Liu
Quoted 20 lines · Daniel Henrique Barboza

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].
Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Quoted 7 lines
Quoted 3 lines

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

Hi, Daniel.

Do we have any plans to support virt-io on the rvsp-ref machine in the future?

Hmmm good question. In theory we're interested only in implementing the rvsp-ref spec but adding virt-io support doesn't hurt the spec implementation in any way ... I think. Drew, any comments?

Quoted 5 lines

Recently, I have been using the RISC-V reference platform built on this set of patches to support running the OpenEuler RISC-V operating system.

I will actively feed back any test results to the upstream.

This series has been stale because, as you might've read in the thread, it turns out we're missing a mandatory extension (sdext).

I get emails from time to time from people asking about the status of this work so I'm considering pushing the patches as is, without sdext, and add documentation saying that this isn't a 100% rsvp-ref compliant board. The absence of sdext seems tolerable for the current uses ppl have for the board ATM, so upstreaming it as is can be beneficial for everyone. We can add sdext support later and then update the docs claiming 100% compliance.

At very least I'll have to send a v4 now that you pointed out a wrong memory address in the memmap, so I'll start with that.

Thanks,

Daniel

Quoted 3 lines

Thanks,
Chao

#17 lore raw
Quoted 38 lines · Daniel Henrique Barboza
Quoted 21 lines · Chao Liu
Quoted 20 lines · Daniel Henrique Barboza

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].
Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Quoted 7 lines
Quoted 3 lines

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

Hi, Daniel.

Do we have any plans to support virt-io on the rvsp-ref machine in the future?

Hmmm good question. In theory we're interested only in implementing the rvsp-ref spec but adding virt-io support doesn't hurt the spec implementation in any way ... I think. Drew, any comments?

Quoted 1 line
Quoted 9 lines
Quoted 4 lines

Recently, I have been using the RISC-V reference platform built on this set of patches to support running the OpenEuler RISC-V operating system.

I will actively feed back any test results to the upstream.

This series has been stale because, as you might've read in the thread, it turns out we're missing a mandatory extension (sdext).

I have a basic version of the sdext extension ready. I’ll improve it later and share it with the upstream community to discuss.

Thank,
Chao

Quoted 19 lines

I get emails from time to time from people asking about the status of this work so I'm considering pushing the patches as is, without sdext, and add documentation saying that this isn't a 100% rsvp-ref compliant board. The absence of sdext seems tolerable for the current uses ppl have for the board ATM, so upstreaming it as is can be beneficial for everyone. We can add sdext support later and then update the docs claiming 100% compliance.

At very least I'll have to send a v4 now that you pointed out a wrong memory address in the memmap, so I'll start with that.

Thanks,

Daniel

Quoted 3 lines

Thanks,
Chao

#18 lore raw
Quoted 45 lines · Chao Liu
Quoted 44 lines · Daniel Henrique Barboza
Quoted 21 lines · Chao Liu
Quoted 20 lines · Daniel Henrique Barboza

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].
Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Quoted 7 lines
Quoted 3 lines

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

Hi, Daniel.

Do we have any plans to support virt-io on the rvsp-ref machine in the future?

Hmmm good question. In theory we're interested only in implementing the rvsp-ref spec but adding virt-io support doesn't hurt the spec implementation in any way ... I think. Drew, any comments?

Quoted 5 lines

Recently, I have been using the RISC-V reference platform built on this set of patches to support running the OpenEuler RISC-V operating system.

I will actively feed back any test results to the upstream.

Quoted 6 lines
Quoted 3 lines

This series has been stale because, as you might've read in the thread, it turns out we're missing a mandatory extension (sdext).

I have a basic version of the sdext extension ready. I’ll improve it later and share it with the upstream community to discuss.

That's awesome! Guess we'll be able to upstream a 100% compliant server platform emulation sooner than I've expected.

Thanks,

Daniel

Quoted 24 lines

Thank,
Chao

Quoted 19 lines

I get emails from time to time from people asking about the status of this work so I'm considering pushing the patches as is, without sdext, and add documentation saying that this isn't a 100% rsvp-ref compliant board. The absence of sdext seems tolerable for the current uses ppl have for the board ATM, so upstreaming it as is can be beneficial for everyone. We can add sdext support later and then update the docs claiming 100% compliance.

At very least I'll have to send a v4 now that you pointed out a wrong memory address in the memmap, so I'll start with that.

Thanks,

Daniel

Quoted 3 lines

Thanks,
Chao

#19 lore raw
Quoted 32 lines · Daniel Henrique Barboza
Quoted 29 lines · Chao Liu
Quoted 28 lines · Daniel Henrique Barboza
Quoted 25 lines · Chao Liu
Quoted 23 lines · Daniel Henrique Barboza

Hi,

This is my attempt to ressurect the Server SoC Platform reference work that has been buried for an year. The last posting was made an year ago [1].
Most of the changes were made due to upstream differences from one year ago. Patch 1 is an example of that.

In patch 2 (former 1), the main difference is the new CPU is rva23s64 compliant. This wasn't possible in May 2024 because we didn't have this support back then.

Patch 3 consists mostly of code base changes rather than functional changes. There was a discussion about whether we should supply fdts in this machine back in the v2 review [2]. The answer is yes: machine mode requires fdt to work, and we want to be flexible enough to generate our own fdt instead of relying on EDK2 to supply them. Note that we can also supply an EDK2-generated fdt via command line, bypassing the fdt created by QEMU, if desired.

Patch 4 adds a riscv-iommu-sys device to the board. This wasn't possible back then because we didn't have the required upstream support for it.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

Hi, Daniel.

Do we have any plans to support virt-io on the rvsp-ref machine in the future?

Hmmm good question. In theory we're interested only in implementing the rvsp-ref spec but adding virt-io support doesn't hurt the spec implementation in any way ... I think. Drew, any comments?

Allowing virtio devices should be fine. I think other reference models have shied away from supporting virtio devices since they want to strictly represent real hardware. Of course there can be real hardware which implements the virtio spec, though, so I don't see a problem of allowing them even when being strict.

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 7 lines

Recently, I have been using the RISC-V reference platform built on this set of patches to support running the OpenEuler RISC-V operating system.

I will actively feed back any test results to the upstream.

This series has been stale because, as you might've read in the thread, it turns out we're missing a mandatory extension (sdext).

Quoted 6 lines
Quoted 2 lines

I have a basic version of the sdext extension ready. I’ll improve it later and share it with the upstream community to discuss.

That's awesome! Guess we'll be able to upstream a 100% compliant server platform emulation sooner than I've expected.

And I would prefer we wait until the reference model is complete before merging it, unless it gets merged with a temporary "experimental" type name.

Thanks,
drew