[PATCH v2 0/4] Add WorldGuard support with wgchecker2

Raymond Mao raymondmaoca at gmail.com
Fri Jul 24 19:38:17 PDT 2026


From: Raymond Mao <raymond.mao at riscstar.com>

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

The implementation base on prerequisite series [2]:
- 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 resource access-controller entries and programs checker MMIO
- parses per-hart CPU defaults from /cpus
- parses per-domain WorldGuard metadata under hw-isolation

During domain transitions, the WorldGuard hart protection
implementation reprograms MLWID and, when available, 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

[1] dt-bindings: riscv: Add RISC-V Worlds and SiFive WorldGuard DT
    bindings
    https://patchwork.kernel.org/project/linux-riscv/list/?series=1113881
[2] [PATCH 0/5] Extend hart protection abstraction for ID configuration
    https://lore.kernel.org/opensbi/20260717074413.2536416-1-anup.patel@oss.qualcomm.com/

Raymond Mao (4):
  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 support with wgchecker2

 docs/domain_support.md                        | 186 ++++++
 include/sbi/riscv_encoding.h                  |   3 +
 include/sbi/sbi_hart.h                        |   4 +
 include/sbi_utils/fdt/fdt_domain.h            |  13 +
 include/sbi_utils/fdt/fdt_helper.h            |  10 +
 lib/sbi/sbi_hart.c                            |   2 +
 lib/utils/fdt/fdt_domain.c                    |  46 +-
 lib/utils/fdt/fdt_helper.c                    |  76 +++
 .../generic/include/qemu_virt_worldguard.h    |  13 +
 platform/generic/include/wgchecker2.h         |  78 +++
 platform/generic/include/worldguard.h         |  44 ++
 platform/generic/objects.mk                   |   3 +
 platform/generic/platform.c                   |  15 +-
 platform/generic/virt/qemu_virt_worldguard.c  |  25 +
 platform/generic/wgchecker2.c                 | 500 ++++++++++++++++
 platform/generic/worldguard.c                 | 553 ++++++++++++++++++
 16 files changed, 1569 insertions(+), 2 deletions(-)
 create mode 100644 platform/generic/include/qemu_virt_worldguard.h
 create mode 100644 platform/generic/include/wgchecker2.h
 create mode 100644 platform/generic/include/worldguard.h
 create mode 100644 platform/generic/virt/qemu_virt_worldguard.c
 create mode 100644 platform/generic/wgchecker2.c
 create mode 100644 platform/generic/worldguard.c

-- 
2.25.1



More information about the opensbi mailing list