Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ajYae-0002zm-56 for mharc-grub-devel@gnu.org; Fri, 25 Mar 2016 16:44:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajYab-0002yA-3v for grub-devel@gnu.org; Fri, 25 Mar 2016 16:44:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajYaW-0007Aj-Vm for grub-devel@gnu.org; Fri, 25 Mar 2016 16:44:13 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:43167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajYaW-0007A6-Nj for grub-devel@gnu.org; Fri, 25 Mar 2016 16:44:08 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u2PKhm1N020063 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2016 20:43:48 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u2PKhm66027800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2016 20:43:48 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u2PKhkPe006935; Fri, 25 Mar 2016 20:43:46 GMT Received: from olila.local.net-space.pl (/10.175.214.206) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Mar 2016 13:43:46 -0700 Date: Fri, 25 Mar 2016 21:43:39 +0100 From: Daniel Kiper To: Konrad Rzeszutek Wilk Subject: Re: [GRUB2 PATCH v5 1/4] i386/relocator: Add grub_relocator64_efi relocator Message-ID: <20160325204339.GQ3489@olila.local.net-space.pl> References: <1458320427-4653-1-git-send-email-daniel.kiper@oracle.com> <1458320427-4653-2-git-send-email-daniel.kiper@oracle.com> <20160325162846.GA20741@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160325162846.GA20741@char.us.oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] 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 20:44:14 -0000 On Fri, Mar 25, 2016 at 12:28:46PM -0400, Konrad Rzeszutek Wilk wrote: > 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? I took this from BSD loader. I assumed that if it uses this value then it is safe to do the same here. However, it looks that we can safely use "4 GiB - RELOCATOR_SIZEOF (64_efi)" too (probably higher value is also good but I do not think we should go that way). If there are not objections then I will repost fixed patch series next week. Daniel