[Xen-devel] [PATCH v2] xen/arm: use correct device tree root node name

Will Abele posted 1 patch 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190709132145.9060-1-will.abele@starlab.io
xen/arch/arm/acpi/domain_build.c | 2 +-
xen/arch/arm/domain_build.c      | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

[Xen-devel] [PATCH v2] xen/arm: use correct device tree root node name

Posted by Will Abele 1 week ago
From: Will Abele <will.abele@starlab.io>

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.

Signed-off-by: Will Abele <will.abele@starlab.io>
---
 xen/arch/arm/acpi/domain_build.c | 2 +-
 xen/arch/arm/domain_build.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_build.c
index 5aae32ac20..1b1cfabb00 100644
--- a/xen/arch/arm/acpi/domain_build.c
+++ b/xen/arch/arm/acpi/domain_build.c
@@ -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;
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d9836779d1..af936b4c3a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -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;
 
-- 
2.22.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v2] xen/arm: use correct device tree root node name

Posted by Julien Grall 1 week ago
Hi Will,

On 7/9/19 2:22 PM, Will Abele wrote:
> From: Will Abele <will.abele@starlab.io>
> 
> 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.
> 
> Signed-off-by: Will Abele <will.abele@starlab.io>

Reviewed-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel