Add WorldGuard support with SiFive WG checker
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 2 repliesIn review
- v24 patches 2 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | lib: utils: fdt: add generic domain and property parsing helpersinclude/ include/ lib/ +1 more | +144 | 0 replies | |
| 2/5 | hart: add WorldGuard CSR IDs and hart extension flagsinclude/ include/ lib/ | +19 | 0 replies | |
| 3/5 | docs: document WorldGuard DT bindingsdocs/ | +212 | 0 replies | |
| 4/5 | platform: generic: add WorldGuard checker supportplatform/ platform/ platform/ +5 more | +1272 | 0 replies | |
| 5/5 | platform: virt: add QEMU WorldGuard overlayplatform/ | +198 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
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