diff mbox series

[v2,9/9] docs: document WID DT properties

Message ID 20260817090503.2104998-10-peter.lin@sifive.com
State Changes Requested
Headers show
Series Add RISC-V Worlds ISA support to OpenSBI | expand

Commit Message

Yu-Chien Peter Lin Aug. 17, 2026, 9:05 a.m. UTC
Add "wid" and "widdeleg" properties to domain instance node
documentation and example DT. Add a "Root Domain Node" section
describing the "root" subnode under the domain configuration
node for root domain WID configuration

Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
---
 docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Pawandeep Oza Sept. 3, 2026, 10:01 p.m. UTC | #1
On Mon, Aug 17, 2026 at 2:05 AM Yu-Chien Peter Lin <peter.lin@sifive.com> wrote:
>
> Add "wid" and "widdeleg" properties to domain instance node
> documentation and example DT. Add a "Root Domain Node" section
> describing the "root" subnode under the domain configuration
> node for root domain WID configuration
>
> Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
> ---
>  docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>
> diff --git a/docs/domain_support.md b/docs/domain_support.md
> index e267a9f7..c35a1d9a 100644
> --- a/docs/domain_support.md
> +++ b/docs/domain_support.md
> @@ -93,6 +93,8 @@ following manner:
>    is the next mode for the ROOT domain
>  * **system_reset_allowed** - The ROOT domain is allowed to reset the system
>  * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
> +* **wid** - Configurable World ID for the ROOT domain
> +* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain
>
>  Domain Effects
>  --------------
> @@ -126,6 +128,23 @@ The DT properties of a domain configuration DT node are as follows:
>  * **compatible** (Mandatory) - The compatible string of the domain
>    configuration. This DT property should have value *"opensbi,domain,config"*
>
> +### Root Domain Node
> +
> +The root domain WID configuration is described in a **root** subnode under
> +the domain configuration DT node. This subnode does not have a compatible
> +string.
> +
> +The DT properties of the root domain node are as follows:
> +
> +* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
> +  (S/U-mode) for the ROOT domain. If present, OpenSBI writes this value
> +  to **mlwid** when entering the ROOT domain (requires Smlwid extension).
> +  If absent, OpenSBI uses the M-mode WID as fallback.
> +* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
> +  the ROOT domain. If present, OpenSBI writes this value to **mwiddeleg**
> +  when entering the ROOT domain (requires Smwiddeleg extension). If absent,
> +  clears **mwiddeleg** to disable S-mode WID delegation.
> +
>  ### Domain Memory Region Node
>
>  The domain memory region DT node describes details of a memory region and
> @@ -204,6 +223,14 @@ The DT properties of a domain instance DT node are as follows:
>    whether the domain instance is allowed to do system reset.
>  * **system-suspend-allowed** (Optional) - A boolean flag representing
>    whether the domain instance is allowed to do system suspend.
> +* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
> +  (S/U-mode) for the domain instance. If present, OpenSBI writes this value
> +  to **mlwid** on context switch into this domain (requires Smlwid extension).
> +  If absent, OpenSBI uses the M-mode WID as fallback.
> +* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
> +  the domain instance. If present, OpenSBI writes this value to **mwiddeleg**
> +  on context switch into this domain (requires Smwiddeleg extension). If absent,
> +  clears **mwiddeleg** to disable S-mode WID delegation.
>
>  ### Assigning HART To Domain Instance
>
> @@ -260,6 +287,11 @@ be done:
>                  order = <64>;
>              };
>
> +            root {
> +                wid = <3>;
> +                widdeleg = <0x0 0x0>;
> +            };
> +
>              tdomain: trusted-domain {
>                  compatible = "opensbi,domain,instance";
>                  possible-harts = <&cpu0>;
> @@ -268,6 +300,8 @@ be done:
>                  next-arg1 = <0x0 0x0>;
>                  next-addr = <0x0 0x80100000>;
>                  next-mode = <0x0>;
> +                wid = <1>;
> +                widdeleg = <0x0 0x6>;
>                  system-reset-allowed;
>                  system-suspend-allowed;
>              };
> @@ -276,6 +310,8 @@ be done:
>                  compatible = "opensbi,domain,instance";
>                  possible-harts = <&cpu1 &cpu2 &cpu3 &cpu4>;
>                  regions = <&tmem 0x0>, <&tuart 0x0>, <&allmem 0x3f>;
> +                wid = <0>;
> +                widdeleg = <0x0 0x1>;
>              };
>          };
>      };
> --
> 2.43.7
>

Reviewed-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com>
Anup Patel Sept. 28, 2026, 8:35 a.m. UTC | #2
On Mon, Aug 17, 2026 at 2:35 PM Yu-Chien Peter Lin <peter.lin@sifive.com> wrote:
>
> Add "wid" and "widdeleg" properties to domain instance node
> documentation and example DT. Add a "Root Domain Node" section
> describing the "root" subnode under the domain configuration
> node for root domain WID configuration
>
> Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
> ---
>  docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>
> diff --git a/docs/domain_support.md b/docs/domain_support.md
> index e267a9f7..c35a1d9a 100644
> --- a/docs/domain_support.md
> +++ b/docs/domain_support.md
> @@ -93,6 +93,8 @@ following manner:
>    is the next mode for the ROOT domain
>  * **system_reset_allowed** - The ROOT domain is allowed to reset the system
>  * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
> +* **wid** - Configurable World ID for the ROOT domain
> +* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain

Based on the below examples, the "wid" and "widdeleg" is also available for
non-ROOT domains so should not have these listed under "Domain Instance"
section as well ??

>
>  Domain Effects
>  --------------
> @@ -126,6 +128,23 @@ The DT properties of a domain configuration DT node are as follows:
>  * **compatible** (Mandatory) - The compatible string of the domain
>    configuration. This DT property should have value *"opensbi,domain,config"*
>
> +### Root Domain Node
> +
> +The root domain WID configuration is described in a **root** subnode under
> +the domain configuration DT node. This subnode does not have a compatible
> +string.
> +
> +The DT properties of the root domain node are as follows:
> +
> +* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
> +  (S/U-mode) for the ROOT domain. If present, OpenSBI writes this value
> +  to **mlwid** when entering the ROOT domain (requires Smlwid extension).
> +  If absent, OpenSBI uses the M-mode WID as fallback.
> +* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
> +  the ROOT domain. If present, OpenSBI writes this value to **mwiddeleg**
> +  when entering the ROOT domain (requires Smwiddeleg extension). If absent,
> +  clears **mwiddeleg** to disable S-mode WID delegation.
> +
>  ### Domain Memory Region Node
>
>  The domain memory region DT node describes details of a memory region and
> @@ -204,6 +223,14 @@ The DT properties of a domain instance DT node are as follows:
>    whether the domain instance is allowed to do system reset.
>  * **system-suspend-allowed** (Optional) - A boolean flag representing
>    whether the domain instance is allowed to do system suspend.
> +* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
> +  (S/U-mode) for the domain instance. If present, OpenSBI writes this value
> +  to **mlwid** on context switch into this domain (requires Smlwid extension).
> +  If absent, OpenSBI uses the M-mode WID as fallback.
> +* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
> +  the domain instance. If present, OpenSBI writes this value to **mwiddeleg**
> +  on context switch into this domain (requires Smwiddeleg extension). If absent,
> +  clears **mwiddeleg** to disable S-mode WID delegation.
>
>  ### Assigning HART To Domain Instance
>
> @@ -260,6 +287,11 @@ be done:
>                  order = <64>;
>              };
>
> +            root {
> +                wid = <3>;
> +                widdeleg = <0x0 0x0>;
> +            };
> +
>              tdomain: trusted-domain {
>                  compatible = "opensbi,domain,instance";
>                  possible-harts = <&cpu0>;
> @@ -268,6 +300,8 @@ be done:
>                  next-arg1 = <0x0 0x0>;
>                  next-addr = <0x0 0x80100000>;
>                  next-mode = <0x0>;
> +                wid = <1>;
> +                widdeleg = <0x0 0x6>;
>                  system-reset-allowed;
>                  system-suspend-allowed;
>              };
> @@ -276,6 +310,8 @@ be done:
>                  compatible = "opensbi,domain,instance";
>                  possible-harts = <&cpu1 &cpu2 &cpu3 &cpu4>;
>                  regions = <&tmem 0x0>, <&tuart 0x0>, <&allmem 0x3f>;
> +                wid = <0>;
> +                widdeleg = <0x0 0x1>;
>              };
>          };
>      };
> --
> 2.43.7
>

Regards,
Anup
Krzysztof Kozlowski Sept. 28, 2026, 11:30 a.m. UTC | #3
On 17/08/2026 11:05, Yu-Chien Peter Lin wrote:
> Add "wid" and "widdeleg" properties to domain instance node
> documentation and example DT. Add a "Root Domain Node" section
> describing the "root" subnode under the domain configuration
> node for root domain WID configuration
> 
> Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
> ---
>  docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/docs/domain_support.md b/docs/domain_support.md
> index e267a9f7..c35a1d9a 100644
> --- a/docs/domain_support.md
> +++ b/docs/domain_support.md
> @@ -93,6 +93,8 @@ following manner:
>    is the next mode for the ROOT domain
>  * **system_reset_allowed** - The ROOT domain is allowed to reset the system
>  * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
> +* **wid** - Configurable World ID for the ROOT domain
> +* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain

Why are you documenting DT in some random docts?

>  
>  Domain Effects
>  --------------
> @@ -126,6 +128,23 @@ The DT properties of a domain configuration DT node are as follows:
>  * **compatible** (Mandatory) - The compatible string of the domain
>    configuration. This DT property should have value *"opensbi,domain,config"*
>  
> +### Root Domain Node
> +
> +The root domain WID configuration is described in a **root** subnode under
> +the domain configuration DT node. This subnode does not have a compatible
> +string.
> +
> +The DT properties of the root domain node are as follows:

NAK, please read writing bindings and both documents for submitting patches.


Best regards,
Krzysztof
Yu-Chien Peter Lin Sept. 29, 2026, 1:33 p.m. UTC | #4
Hi Anup,

On Mon, Sep 28, 2026 at 02:05:32PM +0530, Anup Patel wrote:
> On Mon, Aug 17, 2026 at 2:35 PM Yu-Chien Peter Lin <peter.lin@sifive.com> wrote:
> >
> > Add "wid" and "widdeleg" properties to domain instance node
> > documentation and example DT. Add a "Root Domain Node" section
> > describing the "root" subnode under the domain configuration
> > node for root domain WID configuration
> >
> > Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
> > ---
> >  docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> >
> > diff --git a/docs/domain_support.md b/docs/domain_support.md
> > index e267a9f7..c35a1d9a 100644
> > --- a/docs/domain_support.md
> > +++ b/docs/domain_support.md
> > @@ -93,6 +93,8 @@ following manner:
> >    is the next mode for the ROOT domain
> >  * **system_reset_allowed** - The ROOT domain is allowed to reset the system
> >  * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
> > +* **wid** - Configurable World ID for the ROOT domain
> > +* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain
> 
> Based on the below examples, the "wid" and "widdeleg" is also available for
> non-ROOT domains so should not have these listed under "Domain Instance"
> section as well ??

Yes, they should be added, will fix in the PATCHv3.

Thanks,
Peter Lin

> Regards,
> Anup
Yu-Chien Peter Lin Sept. 29, 2026, 2:19 p.m. UTC | #5
Hi Krzysztof,

On Mon, Sep 28, 2026 at 01:30:28PM +0200, Krzysztof Kozlowski wrote:
> On 17/08/2026 11:05, Yu-Chien Peter Lin wrote:
> > Add "wid" and "widdeleg" properties to domain instance node
> > documentation and example DT. Add a "Root Domain Node" section
> > describing the "root" subnode under the domain configuration
> > node for root domain WID configuration
> > 
> > Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
> > ---
> >  docs/domain_support.md | 36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> > 
> > diff --git a/docs/domain_support.md b/docs/domain_support.md
> > index e267a9f7..c35a1d9a 100644
> > --- a/docs/domain_support.md
> > +++ b/docs/domain_support.md
> > @@ -93,6 +93,8 @@ following manner:
> >    is the next mode for the ROOT domain
> >  * **system_reset_allowed** - The ROOT domain is allowed to reset the system
> >  * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
> > +* **wid** - Configurable World ID for the ROOT domain
> > +* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain
> 
> Why are you documenting DT in some random docts?
> 
> >  
> >  Domain Effects
> >  --------------
> > @@ -126,6 +128,23 @@ The DT properties of a domain configuration DT node are as follows:
> >  * **compatible** (Mandatory) - The compatible string of the domain
> >    configuration. This DT property should have value *"opensbi,domain,config"*
> >  
> > +### Root Domain Node
> > +
> > +The root domain WID configuration is described in a **root** subnode under
> > +the domain configuration DT node. This subnode does not have a compatible
> > +string.
> > +
> > +The DT properties of the root domain node are as follows:
> 
> NAK, please read writing bindings and both documents for submitting patches.

I agree that it should be validated by kernel's
dt_binding_check/dtbs_check tooling.

To support Worlds-based supervisor domain and the
upcoming OP-TEE (and possibly StandaloneMM) trusted
domain use cases, this raises an open question for
Anup and the OpenSBI community: should we start
upstreaming the OpenSBI domain DT bindings
to linux/Documentation/devicetree/bindings?

I can send an RFC if there is consensus.

Thanks,
Peter Lin

> 
> 
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/docs/domain_support.md b/docs/domain_support.md
index e267a9f7..c35a1d9a 100644
--- a/docs/domain_support.md
+++ b/docs/domain_support.md
@@ -93,6 +93,8 @@  following manner:
   is the next mode for the ROOT domain
 * **system_reset_allowed** - The ROOT domain is allowed to reset the system
 * **system_suspend_allowed** - The ROOT domain is allowed to suspend the system
+* **wid** - Configurable World ID for the ROOT domain
+* **widdeleg** - Configurable World ID delegation bitmask for the ROOT domain
 
 Domain Effects
 --------------
@@ -126,6 +128,23 @@  The DT properties of a domain configuration DT node are as follows:
 * **compatible** (Mandatory) - The compatible string of the domain
   configuration. This DT property should have value *"opensbi,domain,config"*
 
+### Root Domain Node
+
+The root domain WID configuration is described in a **root** subnode under
+the domain configuration DT node. This subnode does not have a compatible
+string.
+
+The DT properties of the root domain node are as follows:
+
+* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
+  (S/U-mode) for the ROOT domain. If present, OpenSBI writes this value
+  to **mlwid** when entering the ROOT domain (requires Smlwid extension).
+  If absent, OpenSBI uses the M-mode WID as fallback.
+* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
+  the ROOT domain. If present, OpenSBI writes this value to **mwiddeleg**
+  when entering the ROOT domain (requires Smwiddeleg extension). If absent,
+  clears **mwiddeleg** to disable S-mode WID delegation.
+
 ### Domain Memory Region Node
 
 The domain memory region DT node describes details of a memory region and
@@ -204,6 +223,14 @@  The DT properties of a domain instance DT node are as follows:
   whether the domain instance is allowed to do system reset.
 * **system-suspend-allowed** (Optional) - A boolean flag representing
   whether the domain instance is allowed to do system suspend.
+* **wid** (Optional) - The 32 bit World ID for lower-privilege modes
+  (S/U-mode) for the domain instance. If present, OpenSBI writes this value
+  to **mlwid** on context switch into this domain (requires Smlwid extension).
+  If absent, OpenSBI uses the M-mode WID as fallback.
+* **widdeleg** (Optional) - The 64 bit World ID delegation bitmask for
+  the domain instance. If present, OpenSBI writes this value to **mwiddeleg**
+  on context switch into this domain (requires Smwiddeleg extension). If absent,
+  clears **mwiddeleg** to disable S-mode WID delegation.
 
 ### Assigning HART To Domain Instance
 
@@ -260,6 +287,11 @@  be done:
                 order = <64>;
             };
 
+            root {
+                wid = <3>;
+                widdeleg = <0x0 0x0>;
+            };
+
             tdomain: trusted-domain {
                 compatible = "opensbi,domain,instance";
                 possible-harts = <&cpu0>;
@@ -268,6 +300,8 @@  be done:
                 next-arg1 = <0x0 0x0>;
                 next-addr = <0x0 0x80100000>;
                 next-mode = <0x0>;
+                wid = <1>;
+                widdeleg = <0x0 0x6>;
                 system-reset-allowed;
                 system-suspend-allowed;
             };
@@ -276,6 +310,8 @@  be done:
                 compatible = "opensbi,domain,instance";
                 possible-harts = <&cpu1 &cpu2 &cpu3 &cpu4>;
                 regions = <&tmem 0x0>, <&tuart 0x0>, <&allmem 0x3f>;
+                wid = <0>;
+                widdeleg = <0x0 0x1>;
             };
         };
     };