From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZPBP1-0004uW-Qv for mharc-grub-devel@gnu.org; Tue, 11 Aug 2015 11:23:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPBOz-0004tb-9z for grub-devel@gnu.org; Tue, 11 Aug 2015 11:23:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPBOw-0002rW-42 for grub-devel@gnu.org; Tue, 11 Aug 2015 11:23:45 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:20843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPBOv-0002rG-Je for grub-devel@gnu.org; Tue, 11 Aug 2015 11:23:41 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7BFNUge003588 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Aug 2015 15:23:31 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t7BFNUic024848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 11 Aug 2015 15:23:30 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t7BFNUMc021266; Tue, 11 Aug 2015 15:23:30 GMT Received: from l.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Aug 2015 08:23:29 -0700 Received: by l.oracle.com (Postfix, from userid 1000) id 8DECF6A3C92; Tue, 11 Aug 2015 11:23:27 -0400 (EDT) Date: Tue, 11 Aug 2015 11:23:27 -0400 From: Konrad Rzeszutek Wilk To: Daniel Kiper Subject: Re: [PATCH v2 20/23] x86: add multiboot2 protocol support for EFI platforms Message-ID: <20150811152327.GA32231@l.oracle.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-21-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437402558-7313-21-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: jgross@suse.com, grub-devel@gnu.org, wei.liu2@citrix.com, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, roy.franz@linaro.org, ning.sun@intel.com, david.vrabel@citrix.com, jbeulich@suse.com, phcoder@gmail.com, xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, fu.wei@linaro.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 15:23:46 -0000 > +run_bs: > + push %rax > + push %rdi > + > + /* Initialize BSS (no nasty surprises!). */ > + lea __bss_start(%rip),%rdi > + lea __bss_end(%rip),%rcx > + sub %rdi,%rcx > + shr $3,%rcx > + xor %eax,%eax > + rep stosq This means we are using the %es segment. The multiboot1 is pretty clear that it should cover up to 4GB. Would it be worth adding a comment about that? > + > + pop %rdi > + > + /* > + * IN: %rdi - EFI ImageHandle, %rsi - EFI SystemTable. > + * OUT: %rax - multiboot2.mem_lower. Do not get this value from > + * MULTIBOOT2_TAG_TYPE_BASIC_MEMINFO tag. It could be bogus on > + * EFI platforms. > + */ > + call efi_multiboot2 However the function prototype for efi_multiboot2 is 'void', not 'int' - so it would not return anything! > + > + /* Convert multiboot2.mem_lower to bytes/16. */ Should we check to make sure it is valid? With those weird machines you seem to have run into I am not actually sure what a valid value is :-( .. snip.. > diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c > index c5ae369..d30fe89 100644 > --- a/xen/arch/x86/efi/stub.c > +++ b/xen/arch/x86/efi/stub.c > @@ -13,6 +13,11 @@ struct efi __read_mostly efi = { > .smbios3 = EFI_INVALID_TABLE_ADDR > }; > > +void __init efi_multiboot2(void) unsigned int __init .. > +{ > + /* TODO: Fail if entered! */ And maybe just 'return 0'; ? > +}