dt-bindings: riscv: Add RISC-V Worlds and SiFive WorldGuard DT bindings
Subsystems (3)
v2 cover dt-bindings: riscv: Add RISC-V Worlds and SiFive WorldGuard DT bindings
Add device tree bindings for RISC-V Worlds, a standard extension that tags every transaction with a World ID for fine-grained isolation. SiFive's WorldGuard Checker is a hardware firewall in the system interconnect that inspects transaction WIDs and enforces per-World access policies on memory and MMIO devices.
wgChecker specification reference:
https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdf
Yu-Chien Peter Lin (3):
dt-bindings: riscv: Add Worlds ISA extensions
dt-bindings: riscv: Add Worlds per-hart properties
dt-bindings: sifive: Add WorldGuard Checker
.../devicetree/bindings/riscv/cpus.yaml | 61 +++ .../devicetree/bindings/riscv/extensions.yaml | 53 +++ .../devicetree/bindings/riscv/worlds.yaml | 86 +++++ .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 4 files changed, 556 insertions(+) create mode 100644 Documentation/devicetree/bindings/riscv/worlds.yaml create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Signature · 1 line
2.43.7
PATCH v2 1/3 dt-bindings: riscv: Add Worlds ISA extensions
Add DT bindings for five RISC-V Worlds ISA extensions that implement World ID tagging for hardware-enforced context isolation. Also, add checks for extension dependency requirements.
--- .../devicetree/bindings/riscv/extensions.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +53 -0
@@ -193,12 +193,35 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension. + - const: smlwid + description: | + The standard Smlwid extension for M-mode control of lower + privilege World ID via the mlwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds. + + - const: smlwidlist + description: | + The standard Smlwidlist extension for M-mode control of lower + privilege World IDs via the mlwidlist CSR as ratified at commit + TBD ("TBD") of riscv-worlds. + - const: smstateen description: | The standard Smstateen extension for controlling access to CSRs added by other RISC-V extensions in H/S/VS/U/VU modes and as ratified at commit a28bfae (Ratified (#7)) of riscv-state-enable. + - const: smwiddeleg + description: | + The standard Smwiddeleg extension for M-mode delegation of lower + privilege World ID control to S-mode via the mwiddeleg CSR, as + ratified at commit TBD ("TBD") of riscv-worlds. + + - const: smwid + description: | + The standard Smwid extension for M-mode World ID control via the + mwid CSR as ratified at commit TBD ("TBD") of riscv-worlds. + - const: ssaia description: | The standard Ssaia supervisor-level extension for the advanced
@@ -262,6 +285,12 @@ properties: ratified in RISC-V Profiles Version 1.0, with commit b1d806605f87 ("Updated to ratified state.") + - const: sswid + description: | + The standard Sswid extension for S-mode control of lower + privilege World IDs via the slwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds. + - const: supm description: | The standard Supm extension for pointer masking support in user
@@ -924,6 +953,30 @@ properties: then: contains: const: b + # Smlwidlist depends on Smwid and Smlwid + - if: + contains: + const: smlwidlist + then: + allOf: + - contains: + const: smwid + - contains: + const: smlwid + # Smwiddeleg depends on Smlwid + - if: + contains: + const: smwiddeleg + then: + contains: + const: smlwid + # Sswid depends on Smwiddeleg + - if: + contains: + const: sswid + then: + contains: + const: smwiddeleg # Supm depends on Smnpm or Ssnpm - if: contains:
Signature · 1 line
2.43.7
[email protected]
AI reviewRe: [PATCH v2 1/3] dt-bindings: riscv: Add Worlds ISA extensions
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Medium] S-mode extension 'sswid' imposes an invalid schema dependency on M-mode extension 'smwiddeleg'…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] S-mode extension 'sswid' imposes an invalid schema dependency on M-mode extension 'smwiddeleg', breaking guest VM device trees.
- [Medium] The patch contains 'TBD' placeholders for the ratification commit hashes of the newly added standard extensions.
- [Low] The newly added multi-letter extensions violate the strict alphanumeric sorting requirement.
--
--- Patch [1]: [PATCH v2 1/3] dt-bindings: riscv: Add Worlds ISA extensions --- commit f77a112e3cec85c24b75fb71cd433146ac340c50
Author: Yu-Chien Peter Lin <[email protected]>
dt-bindings: riscv: Add Worlds ISA extensions
This commit adds device tree bindings for five RISC-V Worlds ISA extensions that implement World ID tagging for hardware-enforced context isolation. It also adds checks for extension dependency requirements.
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 200
Quoted 13 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -193,12 +193,35 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension. + - const: smlwid + description: | + The standard Smlwid extension for M-mode control of lower + privilege World ID via the mlwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds.
[Severity: Medium]
Is this extension fully ratified?
The description still contains TBD for the ratification commit hashes here and in the other extensions added by this patch.
Could you update the TBD placeholders with the actual commit hashes if the extensions are complete?
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0+ + - const: smlwidlist + description: | + The standard Smlwidlist extension for M-mode control of lower + privilege World IDs via the mlwidlist CSR as ratified at commit + TBD ("TBD") of riscv-worlds. + - const: smstateen description: | The standard Smstateen extension for controlling access to CSRs
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 220
Quoted 10 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0added by other RISC-V extensions in H/S/VS/U/VU modes and as ratified at commit a28bfae (Ratified (#7)) of riscv-state-enable. + - const: smwiddeleg + description: | + The standard Smwiddeleg extension for M-mode delegation of lower + privilege World ID control to S-mode via the mwiddeleg CSR, as + ratified at commit TBD ("TBD") of riscv-worlds. + + - const: smwid
[Severity: Low]
Does this ordering violate the alphanumeric sorting requirement for multi-letter extensions?
It appears smwiddeleg is placed before smwid, which is alphabetically incorrect since smwid is a prefix and should come first.
Also, smlwid and smlwidlist appear to be inserted out of alphanumeric order compared to the surrounding extensions.
[ ... ]
Quoted 1 line
Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0@@ -924,6 +953,30 @@ properties:
[ ... ]
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 979
Quoted 7 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +7
-0+ # Sswid depends on Smwiddeleg + - if: + contains: + const: sswid + then: + contains: + const: smwiddeleg
[Severity: Medium]
Could this strict dependency cause a regression for guest VM device trees?
This block requires the M-mode smwiddeleg extension to be present whenever the S-mode sswid extension is declared. In RISC-V systems, hypervisors typically only expose Supervisor and User mode extensions to guest VMs.
If a valid guest VM device tree contains sswid but omits M-mode capabilities like smwiddeleg, wouldn't it falsely fail validation?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH v2 1/3] dt-bindings: riscv: Add Worlds ISA extensions
In reply to Yu-Chien Peter LinQuoted 15 lines · Yu-Chien Peter Lin
Add DT bindings for five RISC-V Worlds ISA extensions that implement World ID tagging for hardware-enforced context isolation. Also, add checks for extension dependency requirements.
Signed-off-by Yu-Chien Peter Lin <[email protected]>--- .../devicetree/bindings/riscv/extensions.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 200
Quoted 8 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0@@ -193,12 +193,35 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension. + - const: smlwid + description: | + The standard Smlwid extension for M-mode control of lower + privilege World ID via the mlwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds.
btw, when you send a v3 of this please mark it RFC, since you're using placeholders here for the commit hashes of the extension being frozen.
Cheers,
Conor.
Re: [PATCH v2 1/3] dt-bindings: riscv: Add Worlds ISA extensions
Quoted 19 lines · Conor Dooley
Quoted 18 lines · Yu-Chien Peter Lin
Add DT bindings for five RISC-V Worlds ISA extensions that implement World ID tagging for hardware-enforced context isolation. Also, add checks for extension dependency requirements.
Signed-off-by Yu-Chien Peter Lin <[email protected]>--- .../devicetree/bindings/riscv/extensions.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0@@ -193,12 +193,35 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension.
Quoted 9 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 200
Quoted 5 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0+ - const: smlwid + description: | + The standard Smlwid extension for M-mode control of lower + privilege World ID via the mlwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds.btw, when you send a v3 of this please mark it RFC, since you're using placeholders here for the commit hashes of the extension being frozen.
Sure, will do.
Thanks,
Peter Lin
Quoted 3 lines
Cheers,
Conor.
Re: [PATCH v2 1/3] dt-bindings: riscv: Add Worlds ISA extensions
In reply to Conor DooleyQuoted 19 lines · Conor Dooley
Quoted 18 lines · Yu-Chien Peter Lin
Add DT bindings for five RISC-V Worlds ISA extensions that implement World ID tagging for hardware-enforced context isolation. Also, add checks for extension dependency requirements.
Signed-off-by Yu-Chien Peter Lin <[email protected]>--- .../devicetree/bindings/riscv/extensions.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+)Documentation/devicetree/bindings/riscv/extensions.yaml +0
-0@@ -193,12 +193,35 @@ properties: ratified at commit d70011dde6c2 ("Update to ratified state") of riscv-j-extension.
Quoted 5 lines
Documentation/devicetree/bindings/riscv/extensions.yaml properties: · line 200
Quoted 5 lines
Documentation/devicetree/bindings/riscv/extensions.yaml +5
-0+ - const: smlwid + description: | + The standard Smlwid extension for M-mode control of lower + privilege World ID via the mlwid CSR as ratified at commit + TBD ("TBD") of riscv-worlds.
Also, I will follow alphabetical order in the next version.
Regards,
Peter Lin
PATCH v2 2/3 dt-bindings: riscv: Add Worlds per-hart properties
In reply to Yu-Chien Peter LinAdd per-hart DT properties for the RISC-V Worlds architecture:
riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist. These platform-defined values are primarily used by M-mode firmware to configure World ID CSRs and restrict WID usage across privilege levels.
Also add schema validation rules to enforce valid property combinations based on the ISA extensions present.
--- .../devicetree/bindings/riscv/cpus.yaml | 61 +++++++++++++++ .../devicetree/bindings/riscv/worlds.yaml | 77 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 Documentation/devicetree/bindings/riscv/worlds.yaml
Documentation/devicetree/bindings/riscv/cpus.yaml +61 -0
@@ -26,6 +26,7 @@ description: | allOf: - $ref: /schemas/cpu.yaml# - $ref: extensions.yaml + - $ref: worlds.yaml - if: not: properties:
@@ -39,6 +40,44 @@ allOf: properties: thead,vlenb: false + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smwid + then: + properties: + riscv,pmwidlist: false + + - if: + properties: + riscv,isa-extensions: + not: + contains: + const: smlwid + then: + properties: + riscv,pmlwidlist: false + + - if: + allOf: + - properties: + riscv,isa-extensions: + not: + contains: + const: smwid + - properties: + riscv,isa-extensions: + contains: + enum: + - smlwid + - smwiddeleg + - sswid + then: + required: + - riscv,pmwid + properties: compatible: oneOf:
@@ -120,6 +159,28 @@ properties: thead systems where the vector register length is not identical on all harts, or the vlenb CSR is not available. + riscv,pmwid: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + M-mode World ID (WID) for this hart, M-mode firmware may read this property + to identify the WID for M-mode. For a Worlds-aware platform without any Worlds + ISA implemented, this is the WID for all privilege modes. + minimum: 0 + maximum: 63 + + riscv,pmwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for M-mode use on this hart; each set bit N + indicates WID N is available. Firmware may read this to select a platform + authorized WID. + + riscv,pmlwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for S-mode and U-mode use on this hart; each + set bit N indicates WID N is available. Firmware may read this to select platform + authorized WIDs for lower-privilege modes. # RISC-V has multiple properties for cache op block sizes as the sizes # differ between individual CBO extensions cache-op-block-size: false
Documentation/devicetree/bindings/riscv/worlds.yaml new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
2.43.7
[email protected]
AI reviewRe: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] The CPU node schema incorrectly references the system-wide Worlds schema, bypassing strict…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The CPU node schema incorrectly references the system-wide Worlds schema, bypassing strict property validation for all CPU nodes.
- [High] The schema incorrectly requires the riscv,pmwid property on legacy devicetrees that lack the riscv,isa-extensions property. --
--- Patch [2]: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties --- commit 8c65780e5330e56c6e5f7b6479ae772aa1d15f0c
Author: Yu-Chien Peter Lin <[email protected]>
dt-bindings: riscv: Add Worlds per-hart properties
This commit adds device tree properties to describe the RISC-V Worlds architecture. It introduces system-wide and per-hart configuration properties for World IDs, along with schema validation rules.
Documentation/devicetree/bindings/riscv/cpus.yaml description: | · line 29
Quoted 9 lines
Documentation/devicetree/bindings/riscv/cpus.yaml +1
-0@@ -26,6 +26,7 @@ description: | allOf: - $ref: /schemas/cpu.yaml# - $ref: extensions.yaml + - $ref: worlds.yaml
[Severity: High]
Does this inclusion break the strict property validation for all CPU nodes?
Because worlds.yaml includes additionalProperties: true, JSON schema validation will treat all properties as successfully evaluated.
This neutralizes the unevaluatedProperties: false restriction in cpus.yaml, allowing undocumented or typo'd properties to silently pass validation.
[ ... ]
Quoted 7 lines
Documentation/devicetree/bindings/riscv/cpus.yaml +7
-0+ - if: + allOf: + - properties: + riscv,isa-extensions: + not: + contains: + const: smwid
Documentation/devicetree/bindings/riscv/cpus.yaml allOf: · line 79
Quoted 10 lines
Documentation/devicetree/bindings/riscv/cpus.yaml +10
-0+ - properties: + riscv,isa-extensions: + contains: + enum: + - smlwid + - smwiddeleg + - sswid + then: + required: + - riscv,pmwid
[Severity: High]
Will this erroneously require riscv,pmwid on legacy devicetrees that lack the riscv,isa-extensions property?
In JSON Schema, a properties check automatically succeeds if the specified property is absent.
Without an explicit check requiring riscv,isa-extensions to be present, this conditional evaluates to true when the property is missing. This breaks backward compatibility with older valid devicetrees that use the deprecated riscv,isa property.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Rob Herring (Arm)
maintainerRe: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties
In reply to Yu-Chien Peter LinQuoted 9 lines · Yu-Chien Peter Lin
Add per-hart DT properties for the RISC-V Worlds architecture:
riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist. These platform-defined values are primarily used by M-mode firmware to configure World ID CSRs and restrict WID usage across privilege levels.Also add schema validation rules to enforce valid property combinations based on the ISA extensions present.
Quoted 7 lines
Signed-off-by Yu-Chien Peter Lin <[email protected]>--- .../devicetree/bindings/riscv/cpus.yaml | 61 +++++++++++++++ .../devicetree/bindings/riscv/worlds.yaml | 77 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 Documentation/devicetree/bindings/riscv/worlds.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@0 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@1 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@10 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@11 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties
Hi all,
Quoted 23 lines · Rob Herring (Arm)
Quoted 9 lines · Yu-Chien Peter Lin
Add per-hart DT properties for the RISC-V Worlds architecture:
riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist. These platform-defined values are primarily used by M-mode firmware to configure World ID CSRs and restrict WID usage across privilege levels.Also add schema validation rules to enforce valid property combinations based on the ISA extensions present.
Quoted 7 lines
Signed-off-by Yu-Chien Peter Lin <[email protected]>--- .../devicetree/bindings/riscv/cpus.yaml | 61 +++++++++++++++ .../devicetree/bindings/riscv/worlds.yaml | 77 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 Documentation/devicetree/bindings/riscv/worlds.yamlMy bot found errors running 'make
dt_binding_check' on your patch:yamllint warnings/errors:
Quoted 9 lines
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@0 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@1 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@10 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yamlDocumentation/devicetree/bindings/cpu/idle-states.example.dtb: cpu@11 (riscv): 'riscv,pmwid' is a required property
from schema $id: http://devicetree.org/schemas/riscv/cpus.yaml
I plan to remove the 'required' check for riscv,pmwid in the next version. The riscv,pmwid property is intended to provide a valid fallback when S-domain WID is not specified. This is a platform integration responsibility, not a schema-enforced constraint.
The next version will only retain prohibitive checks — e.g., if the smwid extension is absent, riscv,pmwidlist must not be present.
Regards,
Peter Lin
Re: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties
In reply to Yu-Chien Peter LinDocumentation/devicetree/bindings/riscv/worlds.yaml
Quoted 14 lines · Yu-Chien Peter Lin
Documentation/devicetree/bindings/riscv/cpus.yaml +6
-0+ riscv,pmlwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for S-mode and U-mode use on this hart; each + set bit N indicates WID N is available. Firmware may read this to select platform + authorized WIDs for lower-privilege modes. # RISC-V has multiple properties for cache op block sizes as the sizes # differ between individual CBO extensions cache-op-block-size: falseDocumentation/devicetree/bindings/riscv/worlds.yaml new file +0
-0
Please run scripts/checkpatch.pl on the patches and fix reported warnings. After that, run also 'scripts/checkpatch.pl --strict' on the patches and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.
Quoted 24 lines
Documentation/devicetree/bindings/riscv/worlds.yaml new file +23
-0@@ -0,0 +1,77 @@ +# SPDX-License-Identifier: (GPL-2.0 OR MIT) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/riscv/worlds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: RISC-V Worlds Extension + +maintainers: + - Yu-Chien Peter Lin <[email protected]> + +description: | + The RISC-V Worlds ISA extension, as described in the RISC-V Privileged + Specification, adds World ID tagging for context isolation. + + This binding describes the system-wide Worlds configuration for the /cpus node + and is used alongside per-hart Worlds-related properties such as riscv,pmwid in + the RISC-V CPU binding and Worlds-related ISA extensions enumerated via + riscv,isa-extensions. + +select: + properties: + $nodename:
Documentation/devicetree/bindings/riscv/worlds.yaml line 33
Quoted 10 lines
Documentation/devicetree/bindings/riscv/worlds.yaml new file +10
-0+ pattern: "^cpus$" + +properties: + riscv,nworlds: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + Number of World IDs (WIDs) supported by the platform. This is a system-wide + property that describes the total number of isolation contexts available. + Hardware components such as the WorldGuard Checker use this to determine + the valid range of WID values.
Does not look like property of CPUs, but the "WorldGuard Checker" device node.
Anyway, SoC compatible defines this. Don't add redundant properties.
Best regards,
Krzysztof
Re: [PATCH v2 2/3] dt-bindings: riscv: Add Worlds per-hart properties
Hi Krzysztof,
Quoted 13 lines · Krzysztof Kozlowski
Quoted 12 lines · Yu-Chien Peter Lin
Documentation/devicetree/bindings/riscv/cpus.yaml +6
-0+ riscv,pmlwidlist: + $ref: /schemas/types.yaml#/definitions/uint64 + description: + Optional bitmask of WIDs available for S-mode and U-mode use on this hart; each + set bit N indicates WID N is available. Firmware may read this to select platform + authorized WIDs for lower-privilege modes. # RISC-V has multiple properties for cache op block sizes as the sizes # differ between individual CBO extensions cache-op-block-size: falseDocumentation/devicetree/bindings/riscv/worlds.yaml new file +0
-0
Quoted 8 lines
Documentation/devicetree/bindings/riscv/worlds.yaml
Quoted 2 lines
Documentation/devicetree/bindings/riscv/worlds.yaml new file +0
-0Please run
scripts/checkpatch.plon the patches and fix reported warnings. After that, run also 'scripts/checkpatch.pl--strict' on the patches and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.
The only issue I got is:
WARNING: DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause) #114: FILE: Documentation/devicetree/bindings/riscv/worlds.yaml:1:
+# SPDX-License-Identifier: (GPL-2.0 OR MIT)
Hope I am not missing other warnings or errors.
Thanks,
Peter Lin
PATCH v2 3/3 dt-bindings: sifive: Add WorldGuard Checker
In reply to Yu-Chien Peter LinAdd YAML binding schema for the SiFive wgChecker, a programmable access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Documentation/devicetree/bindings/riscv/worlds.yaml +9 -0
@@ -34,6 +34,14 @@ properties: minimum: 2 maximum: 64 + sifive,trustedwid: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 31 + description: | + The World ID (WID) designated as the trusted WID for this platform. + Transactions tagged with this WID are authorized to access and configure + WorldGuard blocks, including wgCheckers and wgMarkers. + additionalProperties: true examples:
@@ -44,6 +52,7 @@ examples: #size-cells = <0>; timebase-frequency = <1000000>; riscv,nworlds = <4>; + sifive,trustedwid = <3>; cpu@0 { device_type = "cpu";
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +356 -0
356 lines not on this page · raw message
Signature · 1 line
2.43.7
Rob Herring (Arm)
maintainerRe: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
Quoted 22 lines · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
Quoted 6 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/sifive/sifive,wgchecker2.example.dtb: uart@1c1000 (ns16550a): $nodename:0: 'uart@1c1000' does not match '^serial(@.*)?$'
from schema $id: http://devicetree.org/schemas/serial/8250.yamlDocumentation/devicetree/bindings/sifive/sifive,wgchecker2.example.dtb: uart@1c1000 (ns16550a): Unevaluated properties are not allowed ('access-controllers', 'reg-names' were unexpected)
from schema $id: http://devicetree.org/schemas/serial/8250.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/[email protected]
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
Hi Rob,
Quoted 33 lines · Rob Herring (Arm)
Quoted 22 lines · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
Quoted 6 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yamlMy bot found errors running 'make
dt_binding_check' on your patch:
Quoted 7 lines
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.example.dtb: uart@1c1000 (ns16550a): $nodename:0: 'uart@1c1000' does not match '^serial(@.*)?$'
from schema $id: http://devicetree.org/schemas/serial/8250.yamlDocumentation/devicetree/bindings/sifive/sifive,wgchecker2.example.dtb: uart@1c1000 (ns16550a): Unevaluated properties are not allowed ('access-controllers', 'reg-names' were unexpected)
from schema $id: http://devicetree.org/schemas/serial/8250.yaml
Will fix.
Thanks,
Peter Lin
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
In reply to Yu-Chien Peter LinQuoted 1 line · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable
There is no "YAML" binding schema.
Quoted 13 lines
access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Quoted 8 lines
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
What exactly these reviews pointed out?
Quoted 11 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yamlDocumentation/devicetree/bindings/riscv/worlds.yaml +0
-0
Documentation/devicetree/bindings/riscv/worlds.yaml properties: · line 37
Quoted 4 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +1
-0@@ -34,6 +34,14 @@ properties: minimum: 2 maximum: 64 + sifive,trustedwid:
No, for the same reasons.
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Quoted 23 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +8
-0+ $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 31 + description: | + The World ID (WID) designated as the trusted WID for this platform. + Transactions tagged with this WID are authorized to access and configure + WorldGuard blocks, including wgCheckers and wgMarkers. + additionalProperties: true examples:@@ -44,6 +52,7 @@ examples: #size-cells = <0>; timebase-frequency = <1000000>; riscv,nworlds = <4>; + sifive,trustedwid = <3>; cpu@0 { device_type = "cpu";Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +0
-0
No, you do not get per vendor directory. NAK.
Do you see Qcom? Or TI? Or NXP?
Place it in appropriate directory matching the hardware.
Quoted 38 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +37
-0@@ -0,0 +1,356 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2026 SiFive, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sifive/sifive,wgchecker2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiFive WorldGuard Checker + +maintainers: + - Yu-Chien Peter Lin <[email protected]> + +description: | + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural + identifiers that tag each system transaction with its originating context. + System integrators assign WIDs to execution contexts such as privilege modes, + trusted execution environments, or other isolation boundaries. + + The SiFive WorldGuard Checker is a hardware firewall positioned in the + system interconnect fabric. It inspects every transaction, evaluating the + WID against access control policies encoded in checker slots for each + protected resource. Transactions from unauthorized WIDs are blocked and + reported as bus errors, interrupts, or both. + + This enables spatial partitioning of memory regions and memory-mapped devices + across execution contexts. Different address ranges can enforce distinct + policies, allowing isolated workloads to coexist with hardware-enforced + protection. + + The wgChecker acts as an access-controller provider as defined in the + access-controllers framework. Protected devices are consumers that declare + their access policy via the access-controllers property. The hardware + supports up to 32 World IDs. + + The World ID authorized to configure WorldGuard blocks is specified by the + sifive,trustedwid property in the /cpus node. +
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2
You need soc specific compatibles.
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 52
Quoted 5 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +5
-0+ + reg: + maxItems: 1 + description: + Base address and size of the wgChecker memory-mapped I/O registers.
Again, standard comment. Why do you need description?
Quoted 7 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +7
-0+ + interrupts: + maxItems: 1 + description: + Interrupt line asserted when a WID access violation is detected and + interrupt reporting is enabled in the slot configuration (IR or IW + bits set).
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 69
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+ + '#access-controller-cells': + const: 1 + description: | + Specifies the partition identifier to reference a partition child + node that defines the access control region, WID permissions, and + access failure configuration. The special ID 0xFFFFFFFF indicates + unprotected mode, granting unrestricted access to the device. + + '#address-cells':
Use consistent quotes.
Quoted 93 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +93
-0+ const: 1 + + '#size-cells': + const: 0 + +patternProperties: + "^partition@[0-9a-f]+$": + type: object + additionalProperties: false + + properties: + reg: + maximum: 0xFFFFFFFE + description: + Partition identifier. Must be unique within the wgChecker node. + The value 0xFFFFFFFF is reserved for unprotected mode and must + not be used. + + sifive,protected-region: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Protected memory region encoded as a base address and size. + items: + - description: Upper 32 bits of the base address + - description: Lower 32 bits of the base address + - description: Upper 32 bits of the region size + - description: Lower 32 bits of the region size + + sifive,slot-permissions: + $ref: /schemas/types.yaml#/definitions/uint64 + description: | + 64-bit WID permission bitmap. Each WID N uses two consecutive bits: + - bit[2*N] : Read permission for WID N + - bit[2*N+1]: Write permission for WID N + Set bits grant access. + + sifive,slot-config: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 0x1F + description: | + Access failure configuration flags for this slot: + bit[0] (ER): report read violations as bus errors + bit[1] (EW): report write violations as bus errors + bit[2] (IR): report read violations via interrupt + bit[3] (IW): report write violations via interrupt + bit[4] (L) : lock this slot against further modification + Bits[5:31] are reserved and must be zero. + + required: + - reg + - sifive,protected-region + - sifive,slot-permissions + - sifive,slot-config + +required: + - compatible + - reg + - '#address-cells' + - '#size-cells' + - '#access-controller-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + // Example 1: Peripheral device protection + + cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <1000000>; + riscv,nworlds = <4>; + sifive,trustedwid = <3>; + + cpu@0 { + device_type = "cpu"; + reg = <0>; + compatible = "riscv"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "smlwid"; + riscv,pmwid = <3>; + + cpu_intc0: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + }; + + soc {
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 172
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+ #address-cells = <2>; + #size-cells = <2>; + + uart: uart@1c1000 { + compatible = "ns16550a"; + reg = <0x0 0x001c1000 0x0 0x1000>; + reg-names = "control"; + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; + access-controllers = <&wgchecker0 0>; + };
None of these are relevant. Drop all of the nodes.
Please read carefully writing bindings and DTS101 slides before posting next version.
Best regards,
Krzysztof
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
Quoted 13 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2You need soc specific compatibles.
Quoted 2 lines
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
And you WERE TOLD this already at v1 - missing device specific compatibles.
Drop all review tags here, they did not happen.
Best regards,
Krzysztof
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
Quoted 14 lines · Krzysztof Kozlowski
Quoted 13 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2You need soc specific compatibles.
Quoted 7 lines
Quoted 2 lines
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
And you WERE TOLD this already at v1 - missing device specific compatibles.
Drop all review tags here, they did not happen.
Understood.
Best regards,
Peter Lin
Quoted 3 lines
Best regards,
Krzysztof
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
In reply to Krzysztof KozlowskiQuoted 43 lines · Krzysztof Kozlowski
Quoted 1 line · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable
There is no "YAML" binding schema.
Quoted 13 lines
access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Quoted 8 lines
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
What exactly these reviews pointed out?
Quoted 14 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yamlDocumentation/devicetree/bindings/riscv/worlds.yaml +0
-0@@ -34,6 +34,14 @@ properties: minimum: 2 maximum: 64
Quoted 3 lines
Documentation/devicetree/bindings/riscv/worlds.yaml properties: · line 37
Quoted 1 line
Documentation/devicetree/bindings/riscv/worlds.yaml +1
-0+ sifive,trustedwid:No, for the same reasons.
I am not entirely sure that this is defined by the platform compatible, if you've got something like a FPGA with lots of configurability then it may be needed. Then again, yeah maybe it can just come from the platform compatible unlike a device shows up that actually needs it. This is especially true if the consumer of the property is the SBI firmware.
(that's assuming "same reason" follows on from your comment on the prior binding)
Quoted 27 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Quoted 24 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +8
-0+ $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 31 + description: | + The World ID (WID) designated as the trusted WID for this platform. + Transactions tagged with this WID are authorized to access and configure + WorldGuard blocks, including wgCheckers and wgMarkers. + additionalProperties: true examples:@@ -44,6 +52,7 @@ examples: #size-cells = <0>; timebase-frequency = <1000000>; riscv,nworlds = <4>; + sifive,trustedwid = <3>; cpu@0 { device_type = "cpu";Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +0
-0No, you do not get per vendor directory. NAK.
Quoted 3 lines
Do you see Qcom? Or TI? Or NXP?
Place it in appropriate directory matching the hardware.
Which would be access-controllers.
Quoted 53 lines
Quoted 40 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +37
-0@@ -0,0 +1,356 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2026 SiFive, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sifive/sifive,wgchecker2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiFive WorldGuard Checker + +maintainers: + - Yu-Chien Peter Lin <[email protected]> + +description: | + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural + identifiers that tag each system transaction with its originating context. + System integrators assign WIDs to execution contexts such as privilege modes, + trusted execution environments, or other isolation boundaries. + + The SiFive WorldGuard Checker is a hardware firewall positioned in the + system interconnect fabric. It inspects every transaction, evaluating the + WID against access control policies encoded in checker slots for each + protected resource. Transactions from unauthorized WIDs are blocked and + reported as bus errors, interrupts, or both. + + This enables spatial partitioning of memory regions and memory-mapped devices + across execution contexts. Different address ranges can enforce distinct + policies, allowing isolated workloads to coexist with hardware-enforced + protection. + + The wgChecker acts as an access-controller provider as defined in the + access-controllers framework. Protected devices are consumers that declare + their access policy via the access-controllers property. The hardware + supports up to 32 World IDs. + + The World ID authorized to configure WorldGuard blocks is specified by the + sifive,trustedwid property in the /cpus node. +Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2You need soc specific compatibles.
Quoted 2 lines
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
I did okay the qemu compatible FWIW, the standalone sifive one though I did not.
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
Hi Conor and Krzysztof,
Quoted 55 lines · Conor Dooley
Quoted 43 lines · Krzysztof Kozlowski
Quoted 1 line · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable
There is no "YAML" binding schema.
Quoted 13 lines
access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Quoted 8 lines
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
What exactly these reviews pointed out?
Quoted 14 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yamlDocumentation/devicetree/bindings/riscv/worlds.yaml +0
-0@@ -34,6 +34,14 @@ properties: minimum: 2 maximum: 64Quoted 3 lines
Documentation/devicetree/bindings/riscv/worlds.yaml properties: · line 37
Quoted 1 line
Documentation/devicetree/bindings/riscv/worlds.yaml +1
-0+ sifive,trustedwid:No, for the same reasons.
I am not entirely sure that this is defined by the platform compatible, if you've got something like a FPGA with lots of configurability then it may be needed. Then again, yeah maybe it can just come from the platform compatible unlike a device shows up that actually needs it. This is especially true if the consumer of the property is the SBI firmware.
Quoted 2 lines
(that's assuming "same reason" follows on from your comment on the prior binding)
After refactoring the OpenSBI support for the Worlds ISA and wgChecker, I plan to remove riscv,nworlds and sifive,trustedwid in v3.
The riscv,nworlds property is used only to validate the WID range. This validation can be performed using the riscv,pmwid, riscv,pmwidlist, and riscv,pmlwidlist properties, making riscv,nworlds unnecessary.
For sifive,trustedwid, a hart attempting to access wgChecker can probe non-zero value from an MMIO register to verify whether it is trusted, this property may also be unnecessary.
Although some downstream drivers currently require sifive,trustedwid, those drivers are not public yet. Therefore, let’s drop both system-level properties for now.
Quoted 28 lines
Quoted 28 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Quoted 25 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +8
-0+ $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 31 + description: | + The World ID (WID) designated as the trusted WID for this platform. + Transactions tagged with this WID are authorized to access and configure + WorldGuard blocks, including wgCheckers and wgMarkers. + additionalProperties: true examples:@@ -44,6 +52,7 @@ examples: #size-cells = <0>; timebase-frequency = <1000000>; riscv,nworlds = <4>; + sifive,trustedwid = <3>; cpu@0 { device_type = "cpu";Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +0
-0No, you do not get per vendor directory. NAK.
Quoted 5 lines
Quoted 3 lines
Do you see Qcom? Or TI? Or NXP?
Place it in appropriate directory matching the hardware.
Which would be access-controllers.
Thanks for pointing me to the appropriate directory.
Quoted 54 lines
Quoted 54 lines
Quoted 41 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +37
-0@@ -0,0 +1,356 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2026 SiFive, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sifive/sifive,wgchecker2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiFive WorldGuard Checker + +maintainers: + - Yu-Chien Peter Lin <[email protected]> + +description: | + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural + identifiers that tag each system transaction with its originating context. + System integrators assign WIDs to execution contexts such as privilege modes, + trusted execution environments, or other isolation boundaries. + + The SiFive WorldGuard Checker is a hardware firewall positioned in the + system interconnect fabric. It inspects every transaction, evaluating the + WID against access control policies encoded in checker slots for each + protected resource. Transactions from unauthorized WIDs are blocked and + reported as bus errors, interrupts, or both. + + This enables spatial partitioning of memory regions and memory-mapped devices + across execution contexts. Different address ranges can enforce distinct + policies, allowing isolated workloads to coexist with hardware-enforced + protection. + + The wgChecker acts as an access-controller provider as defined in the + access-controllers framework. Protected devices are consumers that declare + their access policy via the access-controllers property. The hardware + supports up to 32 World IDs. + + The World ID authorized to configure WorldGuard blocks is specified by the + sifive,trustedwid property in the /cpus node. +Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2You need soc specific compatibles.
Quoted 5 lines
Quoted 2 lines
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
I did okay the qemu compatible FWIW, the standalone sifive one though I did not.
Sure, will fix.
Best regards,
Peter Lin
Quoted 1 line
Re: [PATCH v2 3/3] dt-bindings: sifive: Add WorldGuard Checker
In reply to Krzysztof KozlowskiHi Krzysztof,
Quoted 73 lines · Krzysztof Kozlowski
Quoted 1 line · Yu-Chien Peter Lin
Add YAML binding schema for the SiFive wgChecker, a programmable
There is no "YAML" binding schema.
Quoted 13 lines
access controller integrated in the interconnect fabric of RISC-V Worlds-capable SoCs.
wgChecker enforces World ID (WID) based access control on downstream bus transactions. Each checker slot encodes a 2-bit permission field per WID (read/write), enabling fine-grained memory partitioning and device isolation between execution contexts. Violations are reported via bus errors, interrupts, or both, selectable and lockable per slot.
The binding registers wgChecker as an access-controllers provider. Consumers (i.e. its protected device) reference it via the standard access-controllers phandle to declare their access requirements.
Quoted 8 lines
Also document the sifive,trustedwid property for the /cpus node, identifying the privileged WID authorized to configure all checkers on the platform.
What exactly these reviews pointed out?
Quoted 11 lines
--- .../devicetree/bindings/riscv/worlds.yaml | 9 + .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yamlDocumentation/devicetree/bindings/riscv/worlds.yaml +0
-0Documentation/devicetree/bindings/riscv/worlds.yaml properties: · line 37
Quoted 4 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +1
-0@@ -34,6 +34,14 @@ properties: minimum: 2 maximum: 64 + sifive,trustedwid:No, for the same reasons.
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Quoted 23 lines
Documentation/devicetree/bindings/riscv/worlds.yaml +8
-0+ $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 31 + description: | + The World ID (WID) designated as the trusted WID for this platform. + Transactions tagged with this WID are authorized to access and configure + WorldGuard blocks, including wgCheckers and wgMarkers. + additionalProperties: true examples:@@ -44,6 +52,7 @@ examples: #size-cells = <0>; timebase-frequency = <1000000>; riscv,nworlds = <4>; + sifive,trustedwid = <3>; cpu@0 { device_type = "cpu";Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +0
-0No, you do not get per vendor directory. NAK.
Quoted 3 lines
Do you see Qcom? Or TI? Or NXP?
Place it in appropriate directory matching the hardware.
Will fix, thanks.
Quoted 53 lines
Quoted 40 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +37
-0@@ -0,0 +1,356 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright (C) 2026 SiFive, Inc. +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sifive/sifive,wgchecker2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiFive WorldGuard Checker + +maintainers: + - Yu-Chien Peter Lin <[email protected]> + +description: | + The RISC-V Worlds ISA extension defines World IDs (WIDs) as architectural + identifiers that tag each system transaction with its originating context. + System integrators assign WIDs to execution contexts such as privilege modes, + trusted execution environments, or other isolation boundaries. + + The SiFive WorldGuard Checker is a hardware firewall positioned in the + system interconnect fabric. It inspects every transaction, evaluating the + WID against access control policies encoded in checker slots for each + protected resource. Transactions from unauthorized WIDs are blocked and + reported as bus errors, interrupts, or both. + + This enables spatial partitioning of memory regions and memory-mapped devices + across execution contexts. Different address ranges can enforce distinct + policies, allowing isolated workloads to coexist with hardware-enforced + protection. + + The wgChecker acts as an access-controller provider as defined in the + access-controllers framework. Protected devices are consumers that declare + their access policy via the access-controllers property. The hardware + supports up to 32 World IDs. + + The World ID authorized to configure WorldGuard blocks is specified by the + sifive,trustedwid property in the /cpus node. +Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 47
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+allOf: + - $ref: /schemas/access-controllers/access-controllers.yaml# + +properties: + compatible: + oneOf: + - items: + - const: qemu,wgchecker2 + - const: sifive,wgchecker2 + - const: sifive,wgchecker2You need soc specific compatibles.
Quoted 2 lines
I do not believe the two review tags did any actual real review. They would tell you to read writing bindings document, wouldn't they?
My bad, will do.
Quoted 8 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 52
Quoted 6 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +5
-0+ + reg: + maxItems: 1 + description: + Base address and size of the wgChecker memory-mapped I/O registers.Again, standard comment. Why do you need description?
Sure, will drop.
Quoted 12 lines
Quoted 12 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +11
-0+ + interrupts: + maxItems: 1 + description: + Interrupt line asserted when a WID access violation is detected and + interrupt reporting is enabled in the slot configuration (IR or IW + bits set). + + '#access-controller-cells': + const: 1 + description: |
Quoted 8 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 69
Quoted 6 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +6
-0+ Specifies the partition identifier to reference a partition child + node that defines the access control region, WID permissions, and + access failure configuration. The special ID 0xFFFFFFFF indicates + unprotected mode, granting unrestricted access to the device. + + '#address-cells':Use consistent quotes.
Sure.
Quoted 107 lines
Quoted 94 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +93
-0+ const: 1 + + '#size-cells': + const: 0 + +patternProperties: + "^partition@[0-9a-f]+$": + type: object + additionalProperties: false + + properties: + reg: + maximum: 0xFFFFFFFE + description: + Partition identifier. Must be unique within the wgChecker node. + The value 0xFFFFFFFF is reserved for unprotected mode and must + not be used. + + sifive,protected-region: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Protected memory region encoded as a base address and size. + items: + - description: Upper 32 bits of the base address + - description: Lower 32 bits of the base address + - description: Upper 32 bits of the region size + - description: Lower 32 bits of the region size + + sifive,slot-permissions: + $ref: /schemas/types.yaml#/definitions/uint64 + description: | + 64-bit WID permission bitmap. Each WID N uses two consecutive bits: + - bit[2*N] : Read permission for WID N + - bit[2*N+1]: Write permission for WID N + Set bits grant access. + + sifive,slot-config: + $ref: /schemas/types.yaml#/definitions/uint32 + maximum: 0x1F + description: | + Access failure configuration flags for this slot: + bit[0] (ER): report read violations as bus errors + bit[1] (EW): report write violations as bus errors + bit[2] (IR): report read violations via interrupt + bit[3] (IW): report write violations via interrupt + bit[4] (L) : lock this slot against further modification + Bits[5:31] are reserved and must be zero. + + required: + - reg + - sifive,protected-region + - sifive,slot-permissions + - sifive,slot-config + +required: + - compatible + - reg + - '#address-cells' + - '#size-cells' + - '#access-controller-cells' + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + // Example 1: Peripheral device protection + + cpus { + #address-cells = <1>; + #size-cells = <0>; + timebase-frequency = <1000000>; + riscv,nworlds = <4>; + sifive,trustedwid = <3>; + + cpu@0 { + device_type = "cpu"; + reg = <0>; + compatible = "riscv"; + riscv,isa-base = "rv64i"; + riscv,isa-extensions = "i", "m", "a", "c", "smlwid"; + riscv,pmwid = <3>; + + cpu_intc0: interrupt-controller { + #interrupt-cells = <1>; + compatible = "riscv,cpu-intc"; + interrupt-controller; + }; + }; + }; + + soc {Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml line 172
Quoted 10 lines
Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml new file +10
-0+ #address-cells = <2>; + #size-cells = <2>; + + uart: uart@1c1000 { + compatible = "ns16550a"; + reg = <0x0 0x001c1000 0x0 0x1000>; + reg-names = "control"; + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; + access-controllers = <&wgchecker0 0>; + };None of these are relevant. Drop all of the nodes.
Quoted 2 lines
Please read carefully writing bindings and DTS101 slides before posting next version.
Sure, thanks for the tutorial, that's very helpful.
Best regards,
Peter Lin
Quoted 4 lines
Best regards,
Krzysztof
Hello Peter,
Quoted 14 lines · Yu-Chien Peter Lin
Add device tree bindings for RISC-V Worlds, a standard extension that tags every transaction with a World ID for fine-grained isolation. SiFive's WorldGuard Checker is a hardware firewall in the system interconnect that inspects transaction WIDs and enforces per-World access policies on memory and MMIO devices.
wgChecker specification reference:
https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdfYu-Chien Peter Lin (3):
dt-bindings: riscv: Add Worlds ISA extensions
dt-bindings: riscv: Add Worlds per-hart properties
dt-bindings: sifive: Add WorldGuard Checker
Quoted 8 lines
.../devicetree/bindings/riscv/cpus.yaml | 61 +++ .../devicetree/bindings/riscv/extensions.yaml | 53 +++ .../devicetree/bindings/riscv/worlds.yaml | 86 +++++ .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 4 files changed, 556 insertions(+)create mode 100644
Documentation/devicetree/bindings/riscv/worlds.yamlcreate mode 100644Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
What's the plan for this and why do we need Linux-specific dt bindings ? This looks more like a set of firmware specific bindings, like OpenSBI domains for example (https://github.com/riscv-software-src/opensbi/blob/master/docs/domain_support.md). I understand adding the ISA extensions in the list (although the fast track is still underway, it's not ratified yet), but the rest don't make sense, not yet at least. How do you plan to use pmlwidlist on Linux to associate processes to wids ? Do you plan on adding a driver for the wg checker (and the markers that you mention) on Linux ? Do you ever expect Linux to run under trustedwid ?
Regards,
Nick
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Hi Nick,
Thanks for the questions.
Quoted 26 lines · Nick Kossifidis
Hello Peter,
Quoted 14 lines · Yu-Chien Peter Lin
Add device tree bindings for RISC-V Worlds, a standard extension that tags every transaction with a World ID for fine-grained isolation. SiFive's WorldGuard Checker is a hardware firewall in the system interconnect that inspects transaction WIDs and enforces per-World access policies on memory and MMIO devices.
wgChecker specification reference:
https://github.com/riscvarchive/security/blob/main/papers/worldguard%20proposal.pdfYu-Chien Peter Lin (3):
dt-bindings: riscv: Add Worlds ISA extensions
dt-bindings: riscv: Add Worlds per-hart properties
dt-bindings: sifive: Add WorldGuard CheckerQuoted 8 lines
.../devicetree/bindings/riscv/cpus.yaml | 61 +++ .../devicetree/bindings/riscv/extensions.yaml | 53 +++ .../devicetree/bindings/riscv/worlds.yaml | 86 +++++ .../bindings/sifive/sifive,wgchecker2.yaml | 356 ++++++++++++++++++ 4 files changed, 556 insertions(+)create mode 100644
Documentation/devicetree/bindings/riscv/worlds.yamlcreate mode 100644Documentation/devicetree/bindings/sifive/sifive,wgchecker2.yaml
Quoted 9 lines
What's the plan for this and why do we need Linux-specific dt bindings ?
This looks more like a set of firmware specific bindings, like OpenSBI
domains for example (https://github.com/riscv-software-src/opensbi/blob/master/docs/domain_support.md).
I understand adding the ISA extensions in the list (although the fast track
is still underway, it's not ratified yet), but the rest don't make sense,
not yet at least. How do you plan to use pmlwidlist on Linux to associate
processes to wids ? Do you plan on adding a driver for the wg checker (and
the markers that you mention) on Linux ? Do you ever expect Linux to run
under trustedwid ?
We do not currently plan to implement a wgChecker driver in the Linux kernel which holds the untrusted WID; wgChecker slot configuration is handled by OpenSBI only at boot-time.
The intention here is providing a standardized device-tree format for describing wgChecker hardware and protection policy, usable consistently across Linux ecosystem (OpenSBI and possibly OP-TEE).
Thanks,
Peter Lin
Quoted 3 lines
Regards,
Nick