From: Yu-Chien Peter Lin <peter.lin@sifive.com>
To: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
alex@ghiti.fr, samuel.holland@sifive.com, dlan@kernel.org,
dfustini@oss.tenstorrent.com, michal.simek@amd.com,
junhui.liu@pigmoral.tech, darshan.prajapati@einfochips.com,
akpm@linux-foundation.org, zhangchunyan@iscas.ac.cn,
luxu.kernel@bytedance.com, pincheng.plct@isrc.iscas.ac.cn,
nick.hu@sifive.com, jim.shu@sifive.com, zong.li@sifive.com,
greentime.hu@sifive.com, robin.randhawa@sifive.com,
scott@riscstar.com, dave.patel@riscstar.com,
raymond.mao@riscstar.com, anup@brainfault.org,
pawandeep.oza@oss.qualcomm.com,
Yu-Chien Peter Lin <peter.lin@sifive.com>
Subject: [RFC PATCH v3 2/3] dt-bindings: riscv: Add Worlds per-hart properties
Date: Wed, 12 Aug 2026 20:21:30 +0800 [thread overview]
Message-ID: <20260812122131.1534906-3-peter.lin@sifive.com> (raw)
In-Reply-To: <20260812122131.1534906-1-peter.lin@sifive.com>
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.
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
---
Changes v2->v3:
- Drop riscv,nworlds property
- Drop 'required' check for riscv,pmwid
---
.../devicetree/bindings/riscv/cpus.yaml | 44 +++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml b/Documentation/devicetree/bindings/riscv/cpus.yaml
index 5feeb2203050..326b68398b90 100644
--- a/Documentation/devicetree/bindings/riscv/cpus.yaml
+++ b/Documentation/devicetree/bindings/riscv/cpus.yaml
@@ -39,6 +39,26 @@ 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
+
properties:
compatible:
oneOf:
@@ -113,6 +133,30 @@ properties:
description:
The blocksize in bytes for the Zicboz cache operations.
+ 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.
+
+ 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.
+
thead,vlenb:
$ref: /schemas/types.yaml#/definitions/uint32
description:
--
2.43.7
next prev parent reply other threads:[~2026-08-12 12:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 12:21 [RFC PATCH v3 0/3] dt-bindings: riscv: Add RISC-V Worlds and SiFive WorldGuard DT bindings Yu-Chien Peter Lin
2026-08-12 12:21 ` [RFC PATCH v3 1/3] dt-bindings: riscv: Add Worlds ISA extensions Yu-Chien Peter Lin
2026-08-12 12:34 ` sashiko-bot
2026-08-12 12:21 ` Yu-Chien Peter Lin [this message]
2026-08-12 12:21 ` [RFC PATCH v3 3/3] dt-bindings: access-controllers: Add SiFive WorldGuard Checker Yu-Chien Peter Lin
2026-08-12 12:28 ` Yu-Chien Peter Lin
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=20260812122131.1534906-3-peter.lin@sifive.com \
--to=peter.lin@sifive.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=darshan.prajapati@einfochips.com \
--cc=dave.patel@riscstar.com \
--cc=devicetree@vger.kernel.org \
--cc=dfustini@oss.tenstorrent.com \
--cc=dlan@kernel.org \
--cc=greentime.hu@sifive.com \
--cc=jim.shu@sifive.com \
--cc=junhui.liu@pigmoral.tech \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=luxu.kernel@bytedance.com \
--cc=michal.simek@amd.com \
--cc=nick.hu@sifive.com \
--cc=palmer@dabbelt.com \
--cc=pawandeep.oza@oss.qualcomm.com \
--cc=pincheng.plct@isrc.iscas.ac.cn \
--cc=pjw@kernel.org \
--cc=raymond.mao@riscstar.com \
--cc=robh@kernel.org \
--cc=robin.randhawa@sifive.com \
--cc=samuel.holland@sifive.com \
--cc=scott@riscstar.com \
--cc=zhangchunyan@iscas.ac.cn \
--cc=zong.li@sifive.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