From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WQG5R-0006lQ-A5 for mharc-grub-devel@gnu.org; Wed, 19 Mar 2014 08:59:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQG5H-0006kz-Mk for grub-devel@gnu.org; Wed, 19 Mar 2014 08:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQG58-0007NK-Vb for grub-devel@gnu.org; Wed, 19 Mar 2014 08:59:03 -0400 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:37034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQG58-0007Mm-KF for grub-devel@gnu.org; Wed, 19 Mar 2014 08:58:54 -0400 Received: by mail-ee0-f50.google.com with SMTP id c13so6518379eek.23 for ; Wed, 19 Mar 2014 05:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=H7pySaURz4IYq6CmbWH6o2f71yNXsW8mG+SIlNy9M6Q=; b=B6BY1OjRYHYahSGO9bgJ9EYyCiiJDkFR5ejDFpVJfZO/tGIfzcOtSm1gp8h8YnD9N7 P/Tf36dz88FE/n11RwQgPawUfdeRCRiRPfT72dCeGS74IxSlgLUs4WS1G5H773T6OHIa prZUyaVd6F/0zkDvn2050uvQ27uV7xR91u5CLFvoPFHe2daK9F2iqGQ0SIRP3zKkYJM5 aLX7FX7c0co/3SoeCP1Kea3nK8W9tTTvPaGE94TaG291xULq27j7S5Vyql2gYiiszo8C cytS8rJksgqZwDBJI4ICJ+KuwpR8U8tckSS7iOdhJ8SYvPI2OnYp7FKqEbeMfVojpiaN AKMQ== X-Received: by 10.15.35.200 with SMTP id g48mr36298eev.111.1395233933386; Wed, 19 Mar 2014 05:58:53 -0700 (PDT) Received: from [129.132.208.47] (vpn-global-dhcp1-47.ethz.ch. [129.132.208.47]) by mx.google.com with ESMTPSA id s46sm54580438ees.3.2014.03.19.05.58.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 05:58:52 -0700 (PDT) Message-ID: <53299483.2040505@gmail.com> Date: Wed, 19 Mar 2014 20:58:43 +0800 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.3.0 MIME-Version: 1.0 To: Daniel Kiper Subject: Re: EFI + GRUB2 + Xen - Boot Services issues References: <20140306192925.GD31874@olila.local.net-space.pl> <20140319094259.GE3454@olila.local.net-space.pl> In-Reply-To: <20140319094259.GE3454@olila.local.net-space.pl> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="267wjOPHDqi4L7OHxpU9UfUtd0ReGjEdf" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::232 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 12:59:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --267wjOPHDqi4L7OHxpU9UfUtd0ReGjEdf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 19.03.2014 17:42, Daniel Kiper wrote: > Hey, >=20 > 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 o= n >> EFI platform I stated that GRUB2 patch 0df77d793c0436be656f982d96d4eda= ea4993f96 >> (Implement multiboot2 EFI BS specification) may not give access to Boo= t >> Services as we earlier expected. >> >> In general above mentioned patch gives a way to prevent ExitBootServic= es() >> 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 sw= itches >> x86 processor mode to 32-bit and disables PG bit in CR0. This is not n= ative >> EFI processor mode. Especially it is very painful on 64-bit EFI implem= entations. >> Even if you can disable ExitBootServices() call later you are not able= to call >> Boot Services functions without switching processor mode (this is quit= e 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= =2E 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_B= S tag >> is in force at least GRUB2 loader should not touch processor mode on E= FI platform >> and it should pass pointer to ImageHandle. I am aware that this is ver= y intrusive >> change and maybe we should consider reverting 0df77d793c0436be656f982d= 96d4edaea4993f96 >> (Implement multiboot2 EFI BS specification) patch from GRUB2 version 2= =2E02 at this >> stage of development because there is no guarantee that this change wi= ll 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 relocat= ion because >> grub_relocator32_boot() is called with last argument (avoid_efi_bootse= rvices) >> set to 0 even if MULTIBOOT2_HEADER_TAG_EFI_BS tag is in force. >=20 > Is there anybody out there? >=20 Sorry, I was travelling. I've seen your mail, just didn't respond to it yet. In nutshell, I think that even in current form it's still useful to allow payloads to follow 32-bit path as long as they wish to keep it and still use BS if they need to. I'll fix clobbering problem. As for long mode entry, it's separate issue, I'm thinking about. There are couple of problems including where to place the paging tables. > Daniel >=20 --267wjOPHDqi4L7OHxpU9UfUtd0ReGjEdf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlMplIkACgkQmBXlbbo5nOuP2AD8CoBt5ZIePlkfRv8WjkUlg+2d i/zEHmakwWztDfYOIykA/jAwRYRfiUSS/ufuRodUwqrQdb6Xud5+VOEIEvtiZVuE =xfL9 -----END PGP SIGNATURE----- --267wjOPHDqi4L7OHxpU9UfUtd0ReGjEdf--