Skip to contentSkip to conversation

xen/arm: use correct device tree root node name

PATCH In review Will Abele 2 participants 2 messages Jul 9, 2019

lore
Share & tools
lore

Will Abele

author
#0 lore raw

PATCH v2 1/1 xen/arm: use correct device tree root node name

From: Will Abele <[email protected]>

The root node of a device tree should not have a node name. This is specified in section 2.2.1 of version 0.2 of the device tree specification, available from devicetree.org.

Linux Kernel versions prior to 4.15 misinterpret flattened device trees with a "/" as the name of the root node as an FDT version older than 16. Linux then fails to parse the FDT.

---
 xen/arch/arm/acpi/domain_build.c | 2 +-
 xen/arch/arm/domain_build.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
xen/arch/arm/acpi/domain_build.c +1 -1
index 5aae32ac20..1b1cfabb00 100644
@@ -145,7 +145,7 @@ static int __init create_acpi_dtb(struct kernel_info *kinfo,
     if ( ret < 0 )
         goto err;
 
-    ret = fdt_begin_node(kinfo->fdt, "/");
+    ret = fdt_begin_node(kinfo->fdt, "");
     if ( ret < 0 )
         goto err;
 
xen/arch/arm/domain_build.c +1 -1
index d9836779d1..af936b4c3a 100644
@@ -1697,7 +1697,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct kernel_info *kinfo)
     if ( ret < 0 )
         goto err;
 
-    ret = fdt_begin_node(kinfo->fdt, "/");
+    ret = fdt_begin_node(kinfo->fdt, "");
     if ( ret < 0 )
         goto err;
 
Signature · 7 lines
2.22.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v2 1/1
#1 lore raw

Hi Will,

Quoted 11 lines · Will Abele

From: Will Abele <[email protected]>

The root node of a device tree should not have a node name. This is specified in section 2.2.1 of version 0.2 of the device tree specification, available from devicetree.org.

Linux Kernel versions prior to 4.15 misinterpret flattened device trees with a "/" as the name of the root node as an FDT version older than 16. Linux then fails to parse the FDT.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel