Skip to contentSkip to conversation

xen/arm: Correctly boot with an initrd and no linux command line

PATCH In review Julien Grall 3 participants 4 messages Feb 10, 2014 – Feb 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Correctly boot with an initrd and no linux command line

When DOM0 device tree is building, the properties for initrd will only be added if there is a linux command line. This will result to a panic later:

(XEN) *** LOADING DOMAIN 0 ***
(XEN) Populate P2M 0x20000000->0x40000000 (1:1 mapping for dom0)
(XEN) Loading kernel from boot module 2
(XEN) Loading zImage from 0000000001000000 to 0000000027c00000-0000000027eafb48 (XEN) Loading dom0 initrd from 0000000002000000 to 0x0000000028200000-0x0000000028c00000 (XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Cannot fix up "linux,initrd-start" property
(XEN) ****************************************
(XEN)

---
This is a bug fix for Xen 4.4. Without this patch, Xen won't boot with
initrd when the linux command is not set.

---
 xen/arch/arm/domain_build.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
xen/arch/arm/domain_build.c +8 -5
index 47b781b..5ca2f15 100644
@@ -209,12 +209,15 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
             return res;
     }
 
-    if ( dt_node_path_is_equal(node, "/chosen") && bootargs )
+    if ( dt_node_path_is_equal(node, "/chosen") )
     {
-        res = fdt_property(kinfo->fdt, "bootargs", bootargs,
-                           strlen(bootargs) + 1);
-        if ( res )
-            return res;
+        if ( bootargs )
+        {
+            res = fdt_property(kinfo->fdt, "bootargs", bootargs,
+                               strlen(bootargs) + 1);
+            if ( res )
+                return res;
+        }
 
         /*
          * If the bootloader provides an initrd, we must create a placeholder
Signature · 1 line
1.7.10.4
#1 lore raw

Forget to cc George.

Quoted 51 lines · Julien Grall

When DOM0 device tree is building, the properties for initrd will only be added if there is a linux command line. This will result to a panic later:

(XEN) *** LOADING DOMAIN 0 ***
(XEN) Populate P2M 0x20000000->0x40000000 (1:1 mapping for dom0)
(XEN) Loading kernel from boot module 2
(XEN) Loading zImage from 0000000001000000 to 0000000027c00000-0000000027eafb48 (XEN) Loading dom0 initrd from 0000000002000000 to 0x0000000028200000-0x0000000028c00000 (XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Cannot fix up "linux,initrd-start" property
(XEN) ****************************************
(XEN)

---
This is a bug fix for Xen 4.4. Without this patch, Xen won't boot with
initrd when the linux command is not set.

---
 xen/arch/arm/domain_build.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
xen/arch/arm/domain_build.c +8 -5
index 47b781b..5ca2f15 100644
@@ -209,12 +209,15 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
             return res;
     }
 
-    if ( dt_node_path_is_equal(node, "/chosen") && bootargs )
+    if ( dt_node_path_is_equal(node, "/chosen") )
     {
-        res = fdt_property(kinfo->fdt, "bootargs", bootargs,
-                           strlen(bootargs) + 1);
-        if ( res )
-            return res;
+        if ( bootargs )
+        {
+            res = fdt_property(kinfo->fdt, "bootargs", bootargs,
+                               strlen(bootargs) + 1);
+            if ( res )
+                return res;
+        }
 
         /*
          * If the bootloader provides an initrd, we must create a placeholder
Signature · 1 line
Julien Grall
#2 lore raw
Quoted 24 lines · Julien Grall

Forget to cc George.

Quoted 21 lines · Julien Grall

When DOM0 device tree is building, the properties for initrd will only be added if there is a linux command line. This will result to a panic later:

(XEN) *** LOADING DOMAIN 0 ***
(XEN) Populate P2M 0x20000000->0x40000000 (1:1 mapping for dom0)
(XEN) Loading kernel from boot module 2
(XEN) Loading zImage from 0000000001000000 to 0000000027c00000-0000000027eafb48 (XEN) Loading dom0 initrd from 0000000002000000 to 0x0000000028200000-0x0000000028c00000 (XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Cannot fix up "linux,initrd-start" property
(XEN) ****************************************
(XEN)

---
This is a bug fix for Xen 4.4. Without this patch, Xen won't boot with
initrd when the linux command is not set.

Oops. :-) Looks like a good risk:

Quoted 31 lines
Quoted 30 lines
---
  xen/arch/arm/domain_build.c |   13 ++++++++-----
  1 file changed, 8 insertions(+), 5 deletions(-)
xen/arch/arm/domain_build.c +8 -5
index 47b781b..5ca2f15 100644
@@ -209,12 +209,15 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
              return res;
      }
 
-    if ( dt_node_path_is_equal(node, "/chosen") && bootargs )
+    if ( dt_node_path_is_equal(node, "/chosen") )
      {
-        res = fdt_property(kinfo->fdt, "bootargs", bootargs,
-                           strlen(bootargs) + 1);
-        if ( res )
-            return res;
+        if ( bootargs )
+        {
+            res = fdt_property(kinfo->fdt, "bootargs", bootargs,
+                               strlen(bootargs) + 1);
+            if ( res )
+                return res;
+        }
 
          /*
           * If the bootloader provides an initrd, we must create a placeholder
#3 lore raw
Quoted 22 lines · George Dunlap
Quoted 21 lines · Julien Grall

Forget to cc George.

Quoted 18 lines · Julien Grall

When DOM0 device tree is building, the properties for initrd will only be added if there is a linux command line. This will result to a panic later:

(XEN) *** LOADING DOMAIN 0 ***
(XEN) Populate P2M 0x20000000->0x40000000 (1:1 mapping for dom0)
(XEN) Loading kernel from boot module 2
(XEN) Loading zImage from 0000000001000000 to 0000000027c00000-0000000027eafb48 (XEN) Loading dom0 initrd from 0000000002000000 to 0x0000000028200000-0x0000000028c00000 (XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Cannot fix up "linux,initrd-start" property
(XEN) ****************************************
(XEN)

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

---
This is a bug fix for Xen 4.4. Without this patch, Xen won't boot with
initrd when the linux command is not set.

Oops. :-) Looks like a good risk:

Acked + Applied, thanks.