mbox series

[v5,0/2] Add support for generating OpenSBI domains in the device tree

Message ID 20240910212533.986734-1-gregorhaas1997@gmail.com (mailing list archive)
Headers show
Series Add support for generating OpenSBI domains in the device tree | expand

Message

Gregor Haas Sept. 10, 2024, 9:25 p.m. UTC
Apologies for the double-email, forgot to run checkpatch ...

This patch series adds support for specifying OpenSBI domains on the QEMU
command line. A simple example of what this looks like is included in the
documentation changes included in this series, along with detailed information
on each option to each of the new flags.

v5:
- Add missing Signed-off-by line in the documentation commit

v4:
- Added license comments to the top of each new file
- Made id mandatory for OpenSBI domains
- Added documentation

v3:
- Addressed review comments from v2 by adding default values to new properties.
  This results in concrete errors at QEMU configuration time if a mandatory
  property (as mandated by the OpenSBI spec) is not provided.
- Changed command line encoding for the possible-harts field from a CPU bitmask
  (e.g. where bit X is set if CPU X is a possible hart) to a range format (e.g.
  the possible harts should be CPUs X-Y, where Y >= X). This does constrain the
  hart assignment to consecutive ranges of harts, but this constraint is also
  present for other QEMU subsystems (such as NUMA).
- Added create_fdt_one_device(), which is invoked when scanning the device tree
  for a memregion's devices. This function allocates a phandle for a region's
  device if one does not yet exist.

v2:
- Addressed review comments from v1. Specifically, renamed domain.{c,h} ->
  opensbi_domain.{c,h} to increase clarity of what these files do. Also, more
  consistently use g_autofree for dynamically allocated variables
- Added an "assign" flag to OpenSBIDomainState, which indicates whether to
  assign the domain's boot hart to it at domain parsing time.

Gregor Haas (2):
  hw/riscv: Add support for generating OpenSBI domains in the device
    tree
  docs/system/riscv: Add documentation for command-line OpenSBI domains

 MAINTAINERS                           |   8 +
 docs/system/riscv/opensbi_domains.rst | 156 +++++++
 docs/system/target-riscv.rst          |  10 +
 hw/riscv/Kconfig                      |   4 +
 hw/riscv/meson.build                  |   1 +
 hw/riscv/opensbi_domain.c             | 558 ++++++++++++++++++++++++++
 hw/riscv/virt.c                       |   3 +
 include/hw/riscv/opensbi_domain.h     |  69 ++++
 8 files changed, 809 insertions(+)
 create mode 100644 docs/system/riscv/opensbi_domains.rst
 create mode 100644 hw/riscv/opensbi_domain.c
 create mode 100644 include/hw/riscv/opensbi_domain.h