Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WQD2W-00022x-J2 for mharc-grub-devel@gnu.org; Wed, 19 Mar 2014 05:44:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQD2M-000218-8K for grub-devel@gnu.org; Wed, 19 Mar 2014 05:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQD2D-0001UW-Ke for grub-devel@gnu.org; Wed, 19 Mar 2014 05:43:50 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:31093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQD2D-0001UP-E3 for grub-devel@gnu.org; Wed, 19 Mar 2014 05:43:41 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s2J9hObw021825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Mar 2014 09:43:25 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2J9hJOd018887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Mar 2014 09:43:20 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s2J9hJ9b011104; Wed, 19 Mar 2014 09:43:19 GMT Received: from olila.local.net-space.pl (/89.174.63.77) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Mar 2014 02:43:18 -0700 Date: Wed, 19 Mar 2014 10:42:59 +0100 From: Daniel Kiper To: phcoder@gmail.com Subject: Re: EFI + GRUB2 + Xen - Boot Services issues Message-ID: <20140319094259.GE3454@olila.local.net-space.pl> References: <20140306192925.GD31874@olila.local.net-space.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140306192925.GD31874@olila.local.net-space.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: grub-devel@gnu.org, keir@xen.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org, jbeulich@suse.com, ross.philipson@citrix.com, richard.l.maliszewski@intel.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: Wed, 19 Mar 2014 09:43:59 -0000 Hey, On Thu, Mar 06, 2014 at 08:29:25PM +0100, Daniel Kiper wrote: > Hi, > > Vladimir, during my work on final multiboot2 protocol support in Xen on > EFI platform I stated that GRUB2 patch 0df77d793c0436be656f982d96d4edaea4993f96 > (Implement multiboot2 EFI BS specification) may not give access to Boot > Services as we earlier expected. > > In general above mentioned patch gives a way to prevent ExitBootServices() > call in GRUB2 which is good. However, it looks that this is only part of > the bigger puzzle. Sadly GRUB2 before jumping into the loaded image switches > x86 processor mode to 32-bit and disables PG bit in CR0. This is not native > EFI processor mode. Especially it is very painful on 64-bit EFI implementations. > Even if you can disable ExitBootServices() call later you are not able to call > Boot Services functions without switching processor mode (this is quite simple) > and recreating page tables (this could be quite complicated). I do not mention > that system table could be unavailable in 32-bit mode because pointer to it > is 64-bit and there is no guarantee that it will be placed below 4 GiB. However, > worst thing is that there is no access to ImageHandle which is needed to call > ExitBootServices(). Hence, I think that if MULTIBOOT2_HEADER_TAG_EFI_BS tag > is in force at least GRUB2 loader should not touch processor mode on EFI platform > and it should pass pointer to ImageHandle. I am aware that this is very intrusive > change and maybe we should consider reverting 0df77d793c0436be656f982d96d4edaea4993f96 > (Implement multiboot2 EFI BS specification) patch from GRUB2 version 2.02 at this > stage of development because there is no guarantee that this change will solve > all problems with BS. This way we avoid situation in which new feature is broken > from the beginning and we are not able to remove it. > > Additionally, I discovered that BS could be overwritten during relocation because > grub_relocator32_boot() is called with last argument (avoid_efi_bootservices) > set to 0 even if MULTIBOOT2_HEADER_TAG_EFI_BS tag is in force. Is there anybody out there? Daniel