From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for-4.4] xen/arm: Correctly boot with an initrd and no linux command line Date: Mon, 10 Feb 2014 17:36:12 +0000 Message-ID: <52F90E0C.4000008@linaro.org> References: <1392053686-16843-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WCumG-0004EV-PE for xen-devel@lists.xenproject.org; Mon, 10 Feb 2014 17:36:16 +0000 Received: by mail-ea0-f170.google.com with SMTP id g15so1392001eak.29 for ; Mon, 10 Feb 2014 09:36:14 -0800 (PST) In-Reply-To: <1392053686-16843-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: George Dunlap , xen-devel@lists.xenproject.org, tim@xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org Forget to cc George. On 02/10/2014 05:34 PM, Julien Grall wrote: > 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) > > Signed-off-by: Julien Grall > > --- > 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(-) > > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c > index 47b781b..5ca2f15 100644 > --- a/xen/arch/arm/domain_build.c > +++ b/xen/arch/arm/domain_build.c > @@ -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 > -- Julien Grall