Skip to content

Add WorldGuard support with SiFive WG checker

Raymond Mao opensbi 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest5 patches 2 repliesIn review
  2. v24 patches 2 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5lib: utils: fdt: add generic domain and property parsing helpersinclude/sbi_utils/fdt/fdt_domain.h include/sbi_utils/fdt/fdt_helper.h lib/utils/fdt/fdt_domain.c +1 more+144 -10 replies
2/5hart: add WorldGuard CSR IDs and hart extension flagsinclude/sbi/riscv_encoding.h include/sbi/sbi_hart.h lib/sbi/sbi_hart.c+19 -00 replies
3/5docs: document WorldGuard DT bindingsdocs/domain_support.md+212 -00 replies
4/5platform: generic: add WorldGuard checker supportplatform/generic/include/qemu_virt_worldguard.h platform/generic/include/wgchecker.h platform/generic/include/worldguard.h +5 more+1272 -10 replies
5/5platform: virt: add QEMU WorldGuard overlayplatform/generic/virt/qemu-virt-wg-overlay.dts+198 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/5] Add WorldGuard support with SiFive WG checker

From: Raymond Mao <[email protected]>

This series adds WorldGuard support according to the wgchecker2 DT- binding proposal from SiFive [1] with QEMU virt integration.

The implementation:
- reuse sbi_hart_protection for hart-local runtime reconfiguration
- reuse sbi_domain_data for per-domain WorldGuard state
- keep WorldGuard-specific setup and checker programming in platform code

At boot, the generic platform code invokes a QEMU virt WorldGuard setup path which:
- parses wgchecker2 checker instances
- parses provider partition@N entries and programs checker MMIO
- parses per-hart CPU defaults from /cpus
- parses per-domain WorldGuard metadata under hw-isolation

Checker programming is provider-driven. Consumer-side access-controllers references are carried for DT-binding alignment.

During domain transitions, the WorldGuard hart protection implementation reprograms MLWID and, when available, MLWIDLIST, MWIDDELEG, and SLWID.

The series is split as follows:
1. add reusable FDT helpers needed by the WorldGuard parser
2. add WorldGuard CSR definitions and hart extension flags
3. document the current DT layout consumed by the implementation
4. add the wgchecker2 / WorldGuard runtime and QEMU virt integration

Tested with:
- QEMU riscv-wg-v4-260821 [2] with arg 'worlds=on' and the merged WorldGuard test DTB.

[1] dt-bindings: riscv: Add RISC-V Worlds and SiFive WorldGuard DT

    bindings
    https://lore.kernel.org/linux-devicetree/[email protected]/

[2] https://github.com/cwshu/qemu/tree/riscv-wg-v4-260821

Raymond Mao (5):
lib: utils: fdt: add generic domain and property parsing helpers
hart: add WorldGuard CSR IDs and hart extension flags
docs: document WorldGuard DT bindings
platform: generic: add WorldGuard checker support [NOT-FOR-UPSTREAM] platform: virt: add QEMU WorldGuard overlay

 docs/domain_support.md                        | 212 +++++++
 include/sbi/riscv_encoding.h                  |   4 +
 include/sbi/sbi_hart.h                        |  10 +
 include/sbi_utils/fdt/fdt_domain.h            |  13 +
 include/sbi_utils/fdt/fdt_helper.h            |  10 +
 lib/sbi/sbi_hart.c                            |   5 +
 lib/utils/fdt/fdt_domain.c                    |  46 +-
 lib/utils/fdt/fdt_helper.c                    |  76 +++
 .../generic/include/qemu_virt_worldguard.h    |  13 +
 platform/generic/include/wgchecker.h          |  91 +++
 platform/generic/include/worldguard.h         |  36 ++
 platform/generic/objects.mk                   |   3 +
 platform/generic/platform.c                   |  15 +-
 .../generic/virt/qemu-virt-wg-overlay.dts     | 198 +++++++
 platform/generic/virt/qemu_virt_worldguard.c  |  25 +
 platform/generic/wgchecker.c                  | 546 ++++++++++++++++++
 platform/generic/worldguard.c                 | 544 +++++++++++++++++
 17 files changed, 1845 insertions(+), 2 deletions(-)
 create mode 100644 platform/generic/include/qemu_virt_worldguard.h
 create mode 100644 platform/generic/include/wgchecker.h
 create mode 100644 platform/generic/include/worldguard.h
 create mode 100644 platform/generic/virt/qemu-virt-wg-overlay.dts
 create mode 100644 platform/generic/virt/qemu_virt_worldguard.c
 create mode 100644 platform/generic/wgchecker.c
 create mode 100644 platform/generic/worldguard.c
Signature · 6 lines
2.25.1

-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi