From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fu Wei Subject: Re: [PATCH v3 0/4] arm64: Add Xen boot support (via fdt) Date: Thu, 29 Oct 2015 10:43:16 +0800 Message-ID: References: <=fu.wei@linaro.org> <1437628583-23667-1-git-send-email-fu.wei@linaro.org> Reply-To: The development of GNU GRUB Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: grub-devel-bounces+gcbgd-grub-devel=m.gmane.org@gnu.org Sender: grub-devel-bounces+gcbgd-grub-devel=m.gmane.org@gnu.org To: Stefano Stabellini Cc: The development of GNU GRUB , xen-devel@lists.xensource.com, Ian Campbell , Andrei Borzenkov , Vladimir Serbinenko , Leif Lindholm , Ryan Harkin , Linaro UEFI Mailman List , Jon Masters List-Id: xen-devel@lists.xenproject.org Hi Stefano, Sorry for late response, I will try to test my latest patch ASAP. but I don't see this problem before. will let you know the result , thanks for your testing On 2 October 2015 at 00:19, Stefano Stabellini wrote: > On Wed, 30 Sep 2015, Stefano Stabellini wrote: >> Hi Fu, >> >> I backported your patches to the CentOS aarch64 grub2 rpm. I am testing >> it on X-Gene with EFI firmware. It works fine when booting Xen, but >> booting native kernels (no Xen) doesn't work anymore. Grub prints >> >> error: out of memory. >> >> Press any key to continue... >> >> grub is still able to continue and load Linux, but then the kernel fails >> to boot with "Cannot open root device", even though the grub config is >> still same as before and the rootfs (which is xfs) hasn't changed. >> Reverting the patches solved the problem. >> >> Do you have any ideas on what is causing the issue? Maybe the initramfs >> hasn't been properly loaded? > > It looks like the following chunk of commit > f8451af8251a3866cb8b7307b9917dd5d34fbd0a "arm64: Export useful functions > from linux.c" causes troubles: > > > diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c > index 117232f..a63a11a 100644 > --- a/grub-core/loader/linux.c > +++ b/grub-core/loader/linux.c > @@ -205,7 +205,8 @@ grub_initrd_init (int argc, char *argv[], > initrd_ctx->nfiles++; > initrd_ctx->components[i].size > = grub_file_size (initrd_ctx->components[i].file); > - initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); > + if (argc != 1) > + initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4); > } > > if (newc) > > > Simply removing this change seems to fix the issue and Xen still boots > fine. -- Best regards, Fu Wei Software Engineer Red Hat Software (Beijing) Co.,Ltd.Shanghai Branch Ph: +86 21 61221326(direct) Ph: +86 186 2020 4684 (mobile) Room 1512, Regus One Corporate Avenue,Level 15, One Corporate Avenue,222 Hubin Road,Huangpu District, Shanghai,China 200021