Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZRg24-0007dJ-OK for mharc-grub-devel@gnu.org; Tue, 18 Aug 2015 08:30:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRg20-0007WY-RZ for grub-devel@gnu.org; Tue, 18 Aug 2015 08:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRg1t-0004If-PM for grub-devel@gnu.org; Tue, 18 Aug 2015 08:30:20 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:33618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRg1t-0004IP-IX for grub-devel@gnu.org; Tue, 18 Aug 2015 08:30:13 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7ICTxaN002804 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Aug 2015 12:30:00 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t7ICTxjk028628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 18 Aug 2015 12:29:59 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t7ICTvQ6028649; Tue, 18 Aug 2015 12:29:57 GMT Received: from olila.local.net-space.pl (/10.175.196.216) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Aug 2015 05:29:56 -0700 Date: Tue, 18 Aug 2015 14:29:50 +0200 From: Daniel Kiper To: Konrad Rzeszutek Wilk Subject: Re: [PATCH v2 6/6] multiboot2: Do not pass memory maps to image if EFI boot services are enabled Message-ID: <20150818122950.GD7143@olila.local.net-space.pl> References: <1437402954-7375-1-git-send-email-daniel.kiper@oracle.com> <1437402954-7375-7-git-send-email-daniel.kiper@oracle.com> <20150811185956.GE1292@l.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150811185956.GE1292@l.oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0022.oracle.com [156.151.31.74] 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, wei.liu2@citrix.com, 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, 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 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: Tue, 18 Aug 2015 12:30:22 -0000 On Tue, Aug 11, 2015 at 02:59:56PM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Jul 20, 2015 at 04:35:54PM +0200, Daniel Kiper wrote: > > Do not pass memory maps to image if it asked for EFI boot services. Maps are > > usually invalid in that case and they can confuse potential user. Image should > > get memory map itself just before ExitBootServices() call. > > Can we point to some commits in Linux or Xen in which these situations > arose? > > Wait, I think there even was one commit in grub. > > Aha: > > ommit e75fdee420a7ad95e9a465c9699adc2e2e970440 > Author: Vladimir 'phcoder' Serbinenko > Date: Tue Mar 26 11:34:56 2013 +0100 > > * grub-core/kern/efi/mm.c (grub_efi_finish_boot_services): > Try terminating EFI services several times due to quirks in some > implementations. > > Otherwise: > > Reviewed-by: Konrad Rzeszutek Wilk Nope, this is a bit different problem. In general GRUB2 assumes that EFI boot services memory regions are free and specify them as such in relevant maps. However, this is not true if you jump into loaded image with EFI boot services enabled. So, we should not expose this maps to the user when he/she asked for access to EFI boot services. This is not very big issue for him/her because he/she can get memory map from EFI just before ExitBootServices() call. This way they will have latest valid memory map. Daniel