OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raymond Mao <raymondmaoca@gmail.com>
To: opensbi@lists.infradead.org
Cc: scott@riscstar.com, dave.patel@riscstar.com,
	raymond.mao@riscstar.com, robin.randhawa@sifive.com,
	samuel.holland@sifive.com, anup.patel@qti.qualcomm.com,
	anuppate@qti.qualcomm.com, anup@brainfault.org,
	dhaval@rivosinc.com, peter.lin@sifive.com
Subject: [PATCH v2 0/4] Add WorldGuard support with wgchecker2
Date: Fri, 24 Jul 2026 22:38:17 -0400	[thread overview]
Message-ID: <20260725023821.3795618-1-raymondmaoca@gmail.com> (raw)

From: Raymond Mao <raymond.mao@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

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

             reply	other threads:[~2026-07-25  2:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-25  2:38 Raymond Mao [this message]
2026-07-25  2:38 ` [PATCH v2 1/4] lib: utils: fdt: add generic domain and property parsing helpers Raymond Mao
2026-07-25  2:38 ` [PATCH v2 2/4] hart: add WorldGuard CSR IDs and hart extension flags Raymond Mao
2026-07-25  2:38 ` [PATCH v2 3/4] docs: document WorldGuard DT bindings Raymond Mao
2026-07-25  2:38 ` [PATCH v2 4/4] platform: generic: add WorldGuard support with wgchecker2 Raymond Mao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260725023821.3795618-1-raymondmaoca@gmail.com \
    --to=raymondmaoca@gmail.com \
    --cc=anup.patel@qti.qualcomm.com \
    --cc=anup@brainfault.org \
    --cc=anuppate@qti.qualcomm.com \
    --cc=dave.patel@riscstar.com \
    --cc=dhaval@rivosinc.com \
    --cc=opensbi@lists.infradead.org \
    --cc=peter.lin@sifive.com \
    --cc=raymond.mao@riscstar.com \
    --cc=robin.randhawa@sifive.com \
    --cc=samuel.holland@sifive.com \
    --cc=scott@riscstar.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox