From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ajUc9-0008JC-1c for mharc-grub-devel@gnu.org; Fri, 25 Mar 2016 12:29:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajUc5-0008HR-R9 for grub-devel@gnu.org; Fri, 25 Mar 2016 12:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajUc1-000721-Kb for grub-devel@gnu.org; Fri, 25 Mar 2016 12:29:29 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:33979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajUc1-00071k-CI for grub-devel@gnu.org; Fri, 25 Mar 2016 12:29:25 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2PGSqkC002313 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2016 16:28:52 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id u2PGSpcF006353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2016 16:28:52 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u2PGSnlC013461; Fri, 25 Mar 2016 16:28:49 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Mar 2016 09:28:49 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 6C8926A00D9; Fri, 25 Mar 2016 12:28:46 -0400 (EDT) Date: Fri, 25 Mar 2016 12:28:46 -0400 From: Konrad Rzeszutek Wilk To: Daniel Kiper Subject: Re: [GRUB2 PATCH v5 1/4] i386/relocator: Add grub_relocator64_efi relocator Message-ID: <20160325162846.GA20741@char.us.oracle.com> References: <1458320427-4653-1-git-send-email-daniel.kiper@oracle.com> <1458320427-4653-2-git-send-email-daniel.kiper@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458320427-4653-2-git-send-email-daniel.kiper@oracle.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0022.oracle.com [141.146.126.234] 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, eric.snowberg@oracle.com, arvidjaar@gmail.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.citrix.com, cardoe@cardoe.com, pgnet.dev@gmail.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, seth.goldberg@oracle.com 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: Fri, 25 Mar 2016 16:29:31 -0000 On Fri, Mar 18, 2016 at 06:00:23PM +0100, Daniel Kiper wrote: > Add grub_relocator64_efi relocator. It will be used on EFI 64-bit platforms > when multiboot2 compatible image requests MULTIBOOT_TAG_TYPE_EFI_BS. Relocator > will set lower parts of %rax and %rbx accordingly to multiboot2 specification. > On the other hand processor mode, just before jumping into loaded image, will > be set accordingly to Unified Extensible Firmware Interface Specification, > Version 2.4 Errata B, section 2.3.4, x64 Platforms, boot services. This way > loaded image will be able to use EFI boot services without any issues. > > Signed-off-by: Daniel Kiper Reviewed-by: Konrad Rzeszutek Wilk .. with one modification: .. snip.. > diff --git a/grub-core/lib/x86_64/efi/relocator.c b/grub-core/lib/x86_64/efi/relocator.c > new file mode 100644 > index 0000000..c93d061 > --- /dev/null > +++ b/grub-core/lib/x86_64/efi/relocator.c > +grub_err_t > +grub_relocator64_efi_boot (struct grub_relocator *rel, > + struct grub_relocator64_efi_state state) > +{ > + grub_err_t err; > + void *relst; > + grub_relocator_chunk_t ch; > + > + err = grub_relocator_alloc_chunk_align (rel, &ch, 0, > + 0x40000000 - RELOCATOR_SIZEOF (64_efi), ^^^^^^^^^^ - why the 1GB? Could you give a bit details on it? Or preferrable have a comment right above saying what that value is used? Thanks.