Skip to contentSkip to conversation

dt-bindings: arm: xen: Convert xen.txt to YAML schema

PATCH Superseded Tejas 3 participants 4 messages Jun 15 – Jun 17 Device tree bindings

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Tejas

author
#0 lore raw

PATCH 1/1 dt-bindings: arm: xen: Convert xen.txt to YAML schema

Convert the Xen ARM device tree binding documentation from the legacy plain-text format (Documentation/devicetree/bindings/arm/xen.txt) to the YAML schema format, as required by the modern DT binding process. The old xen.txt is removed as the YAML schema is now the authoritative source.

The YAML schema:
- Validates compatible string format as "xen,xen-<major>.<minor>" followed by the generic "xen,xen" string
- Documents reg as accepting 1..N regions (region 0 mandatory for grant table mapping; regions 1..N optional extended regions)
- Documents the uefi subnode with correct types:

      * xen,uefi-system-table:   uint64 (guest PA of UEFI System Table)
      * xen,uefi-mmap-start:     uint64 (guest PA of UEFI memory map)
      * xen,uefi-mmap-size:      uint32 (size of UEFI memory map)

* xen,uefi-mmap-desc-size: uint32 (size of each mmap entry)
* xen,uefi-mmap-desc-ver: uint32 (mmap descriptor format version)
- 64-bit properties use /bits/ 64 <value> in the example, consistent with other bindings carrying uint64 properties (e.g. opp-v2.yaml, arm/mali-bifrost.yaml)

The uefi subnode was originally introduced through a multi-version review series (v2..v7); the mistakes caught during those reviews (typos, duplicated UEFI spec content, insufficient description of Xen-specific hypercall semantics) are avoided with deliberate caution here.

Note: the example emits a dtc warning (unit_address_vs_reg) for the /hypervisor node. Both the normative text in xen.txt ("Xen ARM virtual platforms shall have a top-level 'hypervisor' node") and the example in xen.txt mandate this exact node name — the $nodename: const:
hypervisor in the schema is a direct encoding of that pre-existing requirement. A unit address is therefore impossible despite the presence of reg. This warning is pre-existing and not introduced by this conversion.

---
 Documentation/devicetree/bindings/arm/xen.txt |  62 ----------
 .../devicetree/bindings/arm/xen.yaml          | 113 ++++++++++++++++++
 2 files changed, 113 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/xen.txt
 create mode 100644 Documentation/devicetree/bindings/arm/xen.yaml
Documentation/devicetree/bindings/arm/xen.txt deleted +0 -62
deleted file mode 100644
index f925290d4641..000000000000
@@ -1,62 +0,0 @@
-* Xen hypervisor device tree bindings
-
-Xen ARM virtual platforms shall have a top-level "hypervisor" node with
-the following properties:
-
-- compatible:
-	compatible = "xen,xen-<version>", "xen,xen";
-  where <version> is the version of the Xen ABI of the platform.
-
-- reg: specifies the base physical address and size of the regions in memory
-  where the special resources should be mapped to, using an HYPERVISOR_memory_op
-  hypercall.
-  Region 0 is reserved for mapping grant table, it must be always present.
-  The memory region is large enough to map the whole grant table (it is larger
-  or equal to gnttab_max_grant_frames()).
-  Regions 1...N are extended regions (unused address space) for mapping foreign
-  GFNs and grants, they might be absent if there is nothing to expose.
-
-- interrupts: the interrupt used by Xen to inject event notifications.
-  A GIC node is also required.
-
-To support UEFI on Xen ARM virtual platforms, Xen populates the FDT "uefi" node
-under /hypervisor with following parameters:
-
-________________________________________________________________________________
-Name                      | Size   | Description
-================================================================================
-xen,uefi-system-table     | 64-bit | Guest physical address of the UEFI System
-			  |	   | Table.
---------------------------------------------------------------------------------
-xen,uefi-mmap-start       | 64-bit | Guest physical address of the UEFI memory
-			  |	   | map.
---------------------------------------------------------------------------------
-xen,uefi-mmap-size        | 32-bit | Size in bytes of the UEFI memory map
-                          |        | pointed to in previous entry.
---------------------------------------------------------------------------------
-xen,uefi-mmap-desc-size   | 32-bit | Size in bytes of each entry in the UEFI
-                          |        | memory map.
---------------------------------------------------------------------------------
-xen,uefi-mmap-desc-ver    | 32-bit | Version of the mmap descriptor format.
---------------------------------------------------------------------------------
-
-Example (assuming #address-cells = <2> and #size-cells = <2>):
-
-hypervisor {
-	compatible = "xen,xen-4.3", "xen,xen";
-	reg = <0 0xb0000000 0 0x20000>;
-	interrupts = <1 15 0xf08>;
-	uefi {
-		xen,uefi-system-table = <0xXXXXXXXX>;
-		xen,uefi-mmap-start = <0xXXXXXXXX>;
-		xen,uefi-mmap-size = <0xXXXXXXXX>;
-		xen,uefi-mmap-desc-size = <0xXXXXXXXX>;
-		xen,uefi-mmap-desc-ver = <0xXXXXXXXX>;
-        };
-};
-
-The format and meaning of the "xen,uefi-*" parameters are similar to those in
-Documentation/arch/arm/uefi.rst, which are provided by the regular UEFI stub. However
-they differ because they are provided by the Xen hypervisor, together with a set
-of UEFI runtime services implemented via hypercalls, see
-http://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,platform.h.html.
Documentation/devicetree/bindings/arm/xen.yaml new file +113 -0

113 lines not on this page · raw message

Signature · 1 line
2.54.0
author
#1 lore raw

PATCH v2 1/1 dt-bindings: arm: xen: Convert to DT schema

Convert the Xen ARM device tree binding documentation from the legacy plain-text format (Documentation/devicetree/bindings/arm/xen.txt) to the YAML schema format, as required by the modern DT binding process. The old xen.txt is removed as the YAML schema is now the authoritative source.

The YAML schema:
- Uses the preferred dual license (GPL-2.0-only OR BSD-2-Clause)
- Validates compatible string format as "xen,xen-<major>.<minor>" followed by the generic "xen,xen" string
- Documents reg as accepting 1..N regions (region 0 mandatory for grant table mapping; regions 1..N optional extended regions)
- Documents the uefi subnode with correct types:

      * xen,uefi-system-table:   uint64 (guest PA of UEFI System Table)
      * xen,uefi-mmap-start:     uint64 (guest PA of UEFI memory map)
      * xen,uefi-mmap-size:      uint32 (size of UEFI memory map)

* xen,uefi-mmap-desc-size: uint32 (size of each mmap entry)
* xen,uefi-mmap-desc-ver: uint32 (mmap descriptor format version)
- Marks all five xen,uefi-* properties as required within the uefi subnode; the source table lists all of them as unconditionally populated by Xen when UEFI is supported
- 64-bit properties use /bits/ 64 <value> in the example, consistent with other bindings carrying uint64 properties (e.g. opp-v2.yaml, arm/mali-bifrost.yaml)

The uefi subnode was originally introduced through a multi-version review series (v2..v7); the mistakes caught during those reviews (typos, duplicated UEFI spec content, insufficient description of Xen-specific hypercall semantics) are avoided with deliberate caution here.

Note: the example emits a dtc warning (unit_address_vs_reg) for the /hypervisor node. Both the normative text in xen.txt ("Xen ARM virtual platforms shall have a top-level 'hypervisor' node") and the example in xen.txt mandate this exact node name — the $nodename: const:
hypervisor in the schema is a direct encoding of that pre-existing requirement. A unit address is therefore impossible despite the presence of reg. This warning is pre-existing and not introduced by this conversion.

---
Changes since v1:
- Switch to dual license (GPL-2.0-only OR BSD-2-Clause) as required by submitting-patches.rst §3
- Add required: for all five xen,uefi-* properties within the uefi subnode; the source table lists them as unconditionally populated by Xen
- Fix grammar: "an HYPERVISOR_memory_op" -> "a HYPERVISOR_memory_op"
- Fix subject: s/YAML schema/DT schema/ per submitting-patches.rst

 Documentation/devicetree/bindings/arm/xen.txt |  62 ---------
 .../devicetree/bindings/arm/xen.yaml          | 120 ++++++++++++++++++
 2 files changed, 120 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/xen.txt
 create mode 100644 Documentation/devicetree/bindings/arm/xen.yaml
Documentation/devicetree/bindings/arm/xen.txt deleted +0 -62
deleted file mode 100644
index f925290d4641..000000000000
@@ -1,62 +0,0 @@
-* Xen hypervisor device tree bindings
-
-Xen ARM virtual platforms shall have a top-level "hypervisor" node with
-the following properties:
-
-- compatible:
-	compatible = "xen,xen-<version>", "xen,xen";
-  where <version> is the version of the Xen ABI of the platform.
-
-- reg: specifies the base physical address and size of the regions in memory
-  where the special resources should be mapped to, using an HYPERVISOR_memory_op
-  hypercall.
-  Region 0 is reserved for mapping grant table, it must be always present.
-  The memory region is large enough to map the whole grant table (it is larger
-  or equal to gnttab_max_grant_frames()).
-  Regions 1...N are extended regions (unused address space) for mapping foreign
-  GFNs and grants, they might be absent if there is nothing to expose.
-
-- interrupts: the interrupt used by Xen to inject event notifications.
-  A GIC node is also required.
-
-To support UEFI on Xen ARM virtual platforms, Xen populates the FDT "uefi" node
-under /hypervisor with following parameters:
-
-________________________________________________________________________________
-Name                      | Size   | Description
-================================================================================
-xen,uefi-system-table     | 64-bit | Guest physical address of the UEFI System
-			  |	   | Table.
---------------------------------------------------------------------------------
-xen,uefi-mmap-start       | 64-bit | Guest physical address of the UEFI memory
-			  |	   | map.
---------------------------------------------------------------------------------
-xen,uefi-mmap-size        | 32-bit | Size in bytes of the UEFI memory map
-                          |        | pointed to in previous entry.
---------------------------------------------------------------------------------
-xen,uefi-mmap-desc-size   | 32-bit | Size in bytes of each entry in the UEFI
-                          |        | memory map.
---------------------------------------------------------------------------------
-xen,uefi-mmap-desc-ver    | 32-bit | Version of the mmap descriptor format.
---------------------------------------------------------------------------------
-
-Example (assuming #address-cells = <2> and #size-cells = <2>):
-
-hypervisor {
-	compatible = "xen,xen-4.3", "xen,xen";
-	reg = <0 0xb0000000 0 0x20000>;
-	interrupts = <1 15 0xf08>;
-	uefi {
-		xen,uefi-system-table = <0xXXXXXXXX>;
-		xen,uefi-mmap-start = <0xXXXXXXXX>;
-		xen,uefi-mmap-size = <0xXXXXXXXX>;
-		xen,uefi-mmap-desc-size = <0xXXXXXXXX>;
-		xen,uefi-mmap-desc-ver = <0xXXXXXXXX>;
-        };
-};
-
-The format and meaning of the "xen,uefi-*" parameters are similar to those in
-Documentation/arch/arm/uefi.rst, which are provided by the regular UEFI stub. However
-they differ because they are provided by the Xen hypervisor, together with a set
-of UEFI runtime services implemented via hypercalls, see
-http://xenbits.xen.org/docs/unstable/hypercall/x86_64/include,public,platform.h.html.
Documentation/devicetree/bindings/arm/xen.yaml new file +120 -0

120 lines not on this page · raw message

Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH v2] dt-bindings: arm: xen: Convert to DT schema

Quoted 49 lines · Tejas

Convert the Xen ARM device tree binding documentation from the legacy plain-text format (Documentation/devicetree/bindings/arm/xen.txt) to the YAML schema format, as required by the modern DT binding process. The old xen.txt is removed as the YAML schema is now the authoritative source.

The YAML schema:
- Uses the preferred dual license (GPL-2.0-only OR BSD-2-Clause)
- Validates compatible string format as "xen,xen-<major>.<minor>" followed by the generic "xen,xen" string
- Documents reg as accepting 1..N regions (region 0 mandatory for grant table mapping; regions 1..N optional extended regions)
- Documents the uefi subnode with correct types:

      * xen,uefi-system-table:   uint64 (guest PA of UEFI System Table)
      * xen,uefi-mmap-start:     uint64 (guest PA of UEFI memory map)
      * xen,uefi-mmap-size:      uint32 (size of UEFI memory map)

* xen,uefi-mmap-desc-size: uint32 (size of each mmap entry)
* xen,uefi-mmap-desc-ver: uint32 (mmap descriptor format version)
- Marks all five xen,uefi-* properties as required within the uefi subnode; the source table lists all of them as unconditionally populated by Xen when UEFI is supported
- 64-bit properties use /bits/ 64 <value> in the example, consistent with other bindings carrying uint64 properties (e.g. opp-v2.yaml, arm/mali-bifrost.yaml)

The uefi subnode was originally introduced through a multi-version review series (v2..v7); the mistakes caught during those reviews (typos, duplicated UEFI spec content, insufficient description of Xen-specific hypercall semantics) are avoided with deliberate caution here.

Note: the example emits a dtc warning (unit_address_vs_reg) for the /hypervisor node. Both the normative text in xen.txt ("Xen ARM virtual platforms shall have a top-level 'hypervisor' node") and the example in xen.txt mandate this exact node name — the $nodename: const:
hypervisor in the schema is a direct encoding of that pre-existing requirement. A unit address is therefore impossible despite the presence of reg. This warning is pre-existing and not introduced by this conversion.

---
Changes since v1:
- Switch to dual license (GPL-2.0-only OR BSD-2-Clause) as required by submitting-patches.rst §3
- Add required: for all five xen,uefi-* properties within the uefi subnode; the source table lists them as unconditionally populated by Xen
- Fix grammar: "an HYPERVISOR_memory_op" -> "a HYPERVISOR_memory_op"
- Fix subject: s/YAML schema/DT schema/ per submitting-patches.rst

Quoted 6 lines
 Documentation/devicetree/bindings/arm/xen.txt |  62 ---------
 .../devicetree/bindings/arm/xen.yaml          | 120 ++++++++++++++++++
 2 files changed, 120 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/xen.txt
 create mode 100644 Documentation/devicetree/bindings/arm/xen.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/arm/xen.example.dts:13.16-26.7: Warning (unit_address_vs_reg): /hypervisor: node has a reg or ranges property, but no unit name /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/arm/xen.example.dtb: /: 'compatible' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/arm/xen.example.dtb: /: 'model' is a required property
from schema $id: http://devicetree.org/schemas/root-node.yaml

doc reference errors (make refcheckdocs):
Warning: arch/arm/xen/enlighten.c references a file that doesn't exist: Documentation/devicetree/bindings/arm/xen.txt arch/arm/xen/enlighten.c: Documentation/devicetree/bindings/arm/xen.txt

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.

#3 lore raw

Re: [PATCH v2] dt-bindings: arm: xen: Convert to DT schema

In reply to Tejas
Quoted 3 lines · Tejas

Convert the Xen ARM device tree binding documentation from the legacy plain-text format (Documentation/devicetree/bindings/arm/xen.txt) to the YAML schema format, as required by the modern DT binding process.

There is no YAML schema. It's DT schema.

Your SoB does not match author (see submitting patches document).

Do not attach (thread) your patchsets to some other threads (unrelated or older versions). This buries them deep in the mailbox and might interfere with applying entire sets. See also:
https://elixir.bootlin.com/linux/v6.16-rc2/source/Documentation/process/submitting-patches.rst#L830

Quoted 13 lines

The old xen.txt is removed as the YAML schema is now the authoritative source.

The YAML schema:
- Uses the preferred dual license (GPL-2.0-only OR BSD-2-Clause)
- Validates compatible string format as "xen,xen-<major>.<minor>" followed by the generic "xen,xen" string
- Documents reg as accepting 1..N regions (region 0 mandatory for grant table mapping; regions 1..N optional extended regions)
- Documents the uefi subnode with correct types:

      * xen,uefi-system-table:   uint64 (guest PA of UEFI System Table)
      * xen,uefi-mmap-start:     uint64 (guest PA of UEFI memory map)
      * xen,uefi-mmap-size:      uint32 (size of UEFI memory map)
Quoted 8 lines

* xen,uefi-mmap-desc-size: uint32 (size of each mmap entry)
* xen,uefi-mmap-desc-ver: uint32 (mmap descriptor format version)
- Marks all five xen,uefi-* properties as required within the uefi subnode; the source table lists all of them as unconditionally populated by Xen when UEFI is supported
- 64-bit properties use /bits/ 64 <value> in the example, consistent with other bindings carrying uint64 properties (e.g. opp-v2.yaml, arm/mali-bifrost.yaml)

I don't understand the purpose of above paragraphs. Are you explaining the changes done to the binding during conversion? Or explaining the code? You are not suppose to explain the latter - code tells that. There is no single point in repeating the diff in commit msg.

Quoted 5 lines

The uefi subnode was originally introduced through a multi-version review series (v2..v7); the mistakes caught during those reviews (typos, duplicated UEFI spec content, insufficient description of Xen-specific hypercall semantics) are avoided with deliberate caution here.

What does it mean? What mistakes? What is avoided? How did you avoid it?

Quoted 2 lines

Note: the example emits a dtc warning (unit_address_vs_reg) for the

You cannot have such warning, please fix the node.

Quoted 3 lines

/hypervisor node. Both the normative text in xen.txt ("Xen ARM virtual platforms shall have a top-level 'hypervisor' node") and the example in xen.txt mandate this exact node name — the $nodename: const:

Example cannot mandate that.

Quoted 4 lines

hypervisor in the schema is a direct encoding of that pre-existing requirement. A unit address is therefore impossible despite the presence of reg. This warning is pre-existing and not introduced by this conversion.

It is possible. The previous text did not forbid unit address. It only said node name and the name is stuff before @. Look at DT spec:

"node-name@unit-address
The node-name component specifies the name of the node. It shall be 1 to 31 characters in length and consist solely of characters from the set of characters in Table 2.1."

Quoted 3 lines

---

...

Documentation/devicetree/bindings/arm/xen.yaml line 12

Quoted 6 lines
Documentation/devicetree/bindings/arm/xen.yaml new file +6 -0
+title: Xen hypervisor
+
+maintainers:
+  - Stefano Stabellini <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/arm/xen.yaml line 21

Quoted 9 lines
Documentation/devicetree/bindings/arm/xen.yaml new file +9 -0
+  Xen ARM virtual platforms shall have a top-level "hypervisor" node with
+  the properties defined below.
+
+properties:
+  $nodename:
+    const: hypervisor
+
+  compatible:
+    description: |

Drop |

Quoted 26 lines
Documentation/devicetree/bindings/arm/xen.yaml new file +26 -0
+      Specifies the Xen hypervisor. The version of the Xen ABI is encoded
+      in the first item as "xen,xen-<version>", followed by the generic
+      "xen,xen" string.
+    items:
+      - pattern: "^xen,xen-[0-9]+\\.[0-9]+$"
+      - const: xen,xen
+
+  reg:
+    description: |
+      Base physical address and size of the regions in memory where special
+      resources should be mapped to, using a HYPERVISOR_memory_op hypercall.
+
+      Region 0 is reserved for mapping the grant table and must always be
+      present. The memory region must be large enough to map the whole grant
+      table (it is larger or equal to gnttab_max_grant_frames()).
+
+      Regions 1...N are extended regions (unused address space) for mapping
+      foreign GFNs and grants. They might be absent if there is nothing to
+      expose.
+    minItems: 1
+
+  interrupts:
+    description: |
+      The interrupt used by Xen to inject event notifications.
+      A GIC node is also required.
+    maxItems: 1

...

Documentation/devicetree/bindings/arm/xen.yaml line 103

Quoted 8 lines
Documentation/devicetree/bindings/arm/xen.yaml new file +8 -0
+    / {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        gic: interrupt-controller {
+            #interrupt-cells = <3>;
+            interrupt-controller;
+        };

Drop everything above.

Quoted 20 lines
Documentation/devicetree/bindings/arm/xen.yaml new file +17 -0
+
+        hypervisor {
+            compatible = "xen,xen-4.3", "xen,xen";
+            reg = <0 0xb0000000 0 0x20000>;
+            interrupt-parent = <&gic>;
+            interrupts = <1 15 0xf08>;
+
+            uefi {
+                xen,uefi-system-table = /bits/ 64 <0x1301415>;
+                xen,uefi-mmap-start = /bits/ 64 <0x7591400>;
+                xen,uefi-mmap-size = <0x1800>;
+                xen,uefi-mmap-desc-size = <0x30>;
+                xen,uefi-mmap-desc-ver = <1>;
+            };
+        };
+    };
+...
Signature · 1 line
2.54.0