Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YN6JU-0007bK-DB for mharc-grub-devel@gnu.org; Sun, 15 Feb 2015 16:01:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN6JO-0007Zl-Cu for grub-devel@gnu.org; Sun, 15 Feb 2015 16:01:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YN6JJ-0007aU-9Q for grub-devel@gnu.org; Sun, 15 Feb 2015 16:01:06 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:25117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YN6JJ-0007aQ-2l for grub-devel@gnu.org; Sun, 15 Feb 2015 16:01:01 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t1FL0pZ3031928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 15 Feb 2015 21:00:52 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1FL0nDa018513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 15 Feb 2015 21:00:49 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1FL0nDP013100; Sun, 15 Feb 2015 21:00:49 GMT Received: from olila.local.net-space.pl (/10.175.161.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 15 Feb 2015 13:00:48 -0800 Date: Sun, 15 Feb 2015 22:00:36 +0100 From: Daniel Kiper To: Andrei Borzenkov Subject: Re: [PATCH 18/18] x86: add multiboot2 protocol support for EFI platforms Message-ID: <20150215210036.GA17043@olila.local.net-space.pl> References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> <1422640462-28103-19-git-send-email-daniel.kiper@oracle.com> <20150210212749.GG2227@olila.local.net-space.pl> <54DB1EC4020000780005EDDB@mail.emea.novell.com> <20150214202345.4c71bead@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150214202345.4c71bead@opensuse.site> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp1040.oracle.com id t1FL0pZ3031928 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: Juergen Gross , grub-devel@gnu.org, 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, Jan Beulich , 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: Sun, 15 Feb 2015 21:01:11 -0000 On Sat, Feb 14, 2015 at 08:23:45PM +0300, Andrei Borzenkov wrote: > =D0=92 Wed, 11 Feb 2015 08:20:04 +0000 > "Jan Beulich" =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > >>> On 10.02.15 at 22:27, wrote: > > > After some testing we have found at least one machine on which this= thing > > > does not work. It is Dell PowerEdge R820 with latest firmware. Mach= ine > > > crashes/stops because early 32-bit code is not relocatable and must= live > > > under 0x100000 address. (side note: I am surprised how it worked wi= thout > > > any issue until now; Multiboot protocol, any version, does not guar= antee > > > that OS image will be loaded at specified/requested address; > > > > How does it not? It's an ELF binary without relocations that's being > > loaded - I can't see how such could be validly loaded anywhere but > > at the virtual address(es) its program header states (and I don't > > know whether grub [1 or 2] would correctly process relocations if > > there were any, but I doubt it). > > > > grub2 relocates own modules when loading them. It does not do Great! However, it also ignores MULTIBOOT_TAG_TYPE_EFI_BS flag and overwrite BS if it leaves in region requested by image. It is a bug which I have just discovered. I will fix it. > relocation when loading Xen binary, but it does not sound impossible. Ugh... You are right. I was confused because multiboot2 command just allocate memory outside reserved regions. I thought that this is final destination. However, later if you execute boot command then image is relocated to final destination. Facepalm! Anyway, we must support relocatable images in multiboot2 protocol. I think that image (any format, e.g. PE) could inform loader that it can live anywhere below 4 GiB by setting special flag in multiboot2 header. Or ELF image could have relocation section which would be interpreted by loader. Both approaches make sense and are feasible. Daniel