Add RPMI transport and service-group support to the RISC-V Server Platform
Reference Board. The series applies on top of the initial RPMI virt support
series and wires the board's reset, HSM, and system-suspend operations to the
same librpmi-backed implementation used by ``virt``.

The RPMI FDT service nodes are emitted as ``/soc/<service>`` siblings of the
shared-memory mailbox. Each node keeps its ``mboxes`` phandle and
service-group ID, and the server-reference qtest checks this hierarchy as a
regression.

Dependencies:
- [PATCH v16 00/10] riscv: add initial RPMI virt support.
- The server-reference board is already present in QEMU master at
  74f7bf4c59e6b6d50dbc6e124d93440be8be4386.

Changes since v5:
- Rebase onto the initial RPMI v16 prerequisite. Board integration and
  server-reference queue sizes are unchanged.
- [2/2] tests/qtest: cover server reference platform RPMI:
  - Preserve the new doorbell and active-ISA tests in the common harness.
  - Keep machine-specific state available to the early regression helper
    and use the common machine setup for unsupported doorbell writes.
  - Inherit DTB removal before exit-status checks and fatal assertions.

Changes since v4:
- Rebase onto the updated initial RPMI v15 prerequisite; server-reference
  code is unchanged. Wrap one long assertion in the qtest.

Changes since v3:
- Rebase onto QEMU master and the initial RPMI v14 prerequisite.
- Keep the board integration and its queue sizes unchanged.
- [2/2] tests/qtest: cover server reference platform RPMI:
  - Use per-machine queue sizes in the shared harness: virt uses
    30 KiB queues while server-reference retains 1 KiB queues.
    Derive acknowledgement offsets and ring moduli accordingly.
  - Inherit resume-address coverage for RAM-backed PCs, MMIO and
    unmapped rejection, and RV32 width checks on mapped high RAM.

Changes since v2:
- Rebase the server-reference integration onto QEMU master and the v13 RPMI
  virt prerequisite.
- [1/2] hw/riscv: add RPMI support for server reference platform:
  - Add an explicit ``rpmi=on|off`` property, defaulting to off so the
    existing board remains migratable and retains its legacy reset/poweroff
    device-tree nodes.
  - Gate RPMI realization, reset/shutdown callbacks, and service nodes on the
    property; reject explicit enablement for KVM and no-librpmi builds.
  - Document the property, migration restriction, build requirements, and
    both device-tree layouts.
- [2/2] tests/qtest: cover server reference platform RPMI:
  - Reuse the common RPMI protocol tests and register the server-reference
    machine-specific subset.
  - Add checks for default/off and explicit-on machine policy,
    service-node sibling placement, mailbox phandles and service IDs,
    legacy syscon nodes, and migration behavior.
  - Name the RPMI-off migration test as a policy-command acceptance check;
    it does not restore a destination VM.

Testing:
- Both patches build individually with and without librpmi.
- Combined RPMI/server-reference qtests after [2/2]: 32/32 subtests passed.
- Without librpmi, default/off realizes and explicit RPMI enablement
  rejects with the unsupported-build error.
- Normal and TPM Linux boots with RPMI off and on: 4/4 reach login
  using the unmodified device tree.

Subrahmanya Lingappa (2):
  hw/riscv: add RPMI support for server reference platform
  tests/qtest: cover server reference platform RPMI

 docs/system/riscv/riscv-server-ref.rst |  43 ++++
 hw/riscv/Kconfig                       |   1 +
 hw/riscv/server_platform_ref.c         | 149 +++++++++++-
 meson.build                            |   4 +
 tests/qtest/riscv-rpmi-test.c          | 430 +++++++++++++++++++++++++--------
 5 files changed, 529 insertions(+), 98 deletions(-)

base-commit: 74f7bf4c59e6b6d50dbc6e124d93440be8be4386
prerequisite-patch-id: 8fffcd6b5c68f533d85fdcd7c427113bdb609577
prerequisite-patch-id: 7117af90e495eb5c358091576b26118d304054dc
prerequisite-patch-id: d745e935ff34157805c5fa043b92f1ffed09c99c
prerequisite-patch-id: 5d8b74a31f56484a810c44c656616f5fc17ffd2b
prerequisite-patch-id: ee4b16cba8eb1048cd3377d7b1aa78a839d84c41
prerequisite-patch-id: 3b3fada964e9e927359bb168f49d3417f7e8b798
prerequisite-patch-id: aed503f0f29d981051f5d286fafd766c8957f784
prerequisite-patch-id: f05e533da8e2eecca237d3fb54cf7a324aee8dae
prerequisite-patch-id: eac8078c13dbcfa70fd4e9cd7df234f7f33c7912
prerequisite-patch-id: 2f98fd26829eb693b33ef3076c375290eaf4541c

Reply via email to