From: Daniel Kiper Subject: Re: [PATCH RFC 5/7] xen/x86: Add multiboot2 protocol support Date: Tue, 9 Sep 2014 15:34:44 +0200 Message-ID: <20140909133444.GQ3459@olila.local.net-space.pl> References: <1407539046-16910-1-git-send-email-daniel.kiper@oracle.com> <1407539046-16910-6-git-send-email-daniel.kiper@oracle.com> <53E7AAAB.7020706@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XRLZd-0005PO-Sv for xen-devel@lists.xenproject.org; Tue, 09 Sep 2014 13:35:09 +0000 Content-Disposition: inline In-Reply-To: <53E7AAAB.7020706@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, roy.franz@linaro.org, ning.sun@intel.com, jbeulich@suse.com, ross.philipson@citrix.com, xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org On Sun, Aug 10, 2014 at 06:23:55PM +0100, Andrew Cooper wrote: > On 09/08/14 00:04, Daniel Kiper wrote: > > Add multiboot2 protocol support. This way we are laying the foundation > > for EFI + GRUB2 + Xen development. > > > > Signed-off-by: Daniel Kiper > > --- > > xen/arch/x86/boot/head.S | 112 ++++++++++++++++++++++++++++++++++++++++++++- > > xen/arch/x86/boot/reloc.c | 103 ++++++++++++++++++++++++++++++++++++++++- > > 2 files changed, 212 insertions(+), 3 deletions(-) > > > > diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S [...] > > @@ -81,10 +144,55 @@ __start: > > mov %ecx,%es > > mov %ecx,%ss > > > > + /* Set mem_lower to 0 */ > > + xor %edx,%edx > > + > > How does this affect mem_lower? it doesn't appear relevant in context. %edx is used to store mem_lower value from multiboot[12] protocol. It must have sensible value even if multiboot loader do not pass mem_lower value. That is why %edx is zeroed here. > > /* Check for Multiboot bootloader */ > > - cmp $0x2BADB002,%eax > > - jne not_multiboot > > + cmp $MULTIBOOT_BOOTLOADER_MAGIC,%eax > > + je 1f > > This $MULTIBOOT_BOOTLOADER_MAGIC should probably be separate, as there > are other bits of code which should use multiboot manifest constants. You mean? > It looks as if this should be "je multiboot1_entry" ... OK. > > + > > + /* Check for Multiboot2 bootloader */ > > + cmp $MULTIBOOT2_BOOTLOADER_MAGIC,%eax > > + je 2f > > + > > + jmp not_multiboot > > + > > +1: > > + /* Get mem_lower from Multiboot information */ > > + testb $MBI_MEMLIMITS,(%ebx) > > + jz 0f /* not available? BDA value will be fine */ > > > > + mov 4(%ebx),%edx > > + shl $10-4,%edx > > + jmp 0f > > and these 0f's should be "setup_trampoline" or similar. You have also OK. > removed some sanity checks of the multiboot information, which need > reintroducing. No, here we are just reading basic data passed via multiboot[12] protocol. All needed checks are done later. Relevant code is not changed (excluding some register shuffling done in earlier patch). Daniel