Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YyRN0-0005fh-9f for mharc-grub-devel@gnu.org; Fri, 29 May 2015 16:59:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyRMy-0005fb-Ka for grub-devel@gnu.org; Fri, 29 May 2015 16:59:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyRMv-0006pp-Bc for grub-devel@gnu.org; Fri, 29 May 2015 16:59:08 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:35291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyRMv-0006pU-5C for grub-devel@gnu.org; Fri, 29 May 2015 16:59:05 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t4TKwqwO023465 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 May 2015 20:58:52 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t4TKwps5031900 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 29 May 2015 20:58:51 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t4TKwopt000666; Fri, 29 May 2015 20:58:50 GMT Received: from olila.local.net-space.pl (/10.175.203.182) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 29 May 2015 13:58:49 -0700 Date: Fri, 29 May 2015 22:58:43 +0200 From: Daniel Kiper To: "Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko" Subject: Re: [PATCH 3/5] i386/relocator: Remove unused avoid_efi_bootservices argument Message-ID: <20150529205843.GL3787@olila.local.net-space.pl> References: <1422640768-28181-1-git-send-email-daniel.kiper@oracle.com> <1422640768-28181-4-git-send-email-daniel.kiper@oracle.com> <554B8D05.4000004@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <554B8D05.4000004@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by userp1040.oracle.com id t4TKwqwO023465 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, keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, stefano.stabellini@eu.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: Fri, 29 May 2015 20:59:09 -0000 Hey, Sorry for late reply but I was busy with our internal EFI stuff. We did more tests and some fixes and it seems that everything is going in right direction. Well, I hope... :-))) Right now I am going to continue my work on upstream EFI + GRUB2 + Xen stuff. I think that I will be able to relea= se new patch series for GRUB2 and Xen in second or third week of June (next week we have 2 days holiday in Poland). Stay tuned... On Thu, May 07, 2015 at 06:04:21PM +0200, Vladimir '=CF=86-coder/phcoder'= Serbinenko wrote: > Not unused: > grub_efi_mmap_iterate (grub_relocator_alloc_chunk_align_iter, &ctx, > avoid_efi_boot_services); In general I have a problem with avoid_efi_boot_services stuff in GRUB2. By default it is disabled and GRUB2 assumes that boot services (BS) memor= y regions (code and data) are free. This means that it may put there loaded= image and/or fills memory maps (MULTIBOOT_TAG_TYPE_BASIC_MEMINFO, MULTIBOOT_TAG= _TYPE_MMAP) with above mentioned regions marked as free. This is OK when BS are disab= led before loaded image exaction. However, we introduced new feature like MULTIBOOT_TAG_TYPE_EFI_BS (I am going to improve/extend it) and this make= s this behavior more problematic. It means that now GRUB2 with MULTIBOOT_TA= G_TYPE_EFI_BS enabled may overwrite BS regions and/or memory maps are bogus. In turn, t= his means that BS are potentially unusable by loaded image which asked for BS with = above mentioned tag. So, I think that we should find a solution for that issues. The simplest fix for that problem seems total removal of avoid_efi_boot_s= ervices and assumption that BS memory regions are not free. I did some tests with= that but not so many and not so deep. I discovered that at least linux loader = (IIRC) has some issues with this solution. Maybe it could be fixed easily but I = did not investigated this issue so long. Additionally, I realized that boot s= ervices regions are quite big (dozens or even about 100 MiB) and maybe this is no= t very nice idea to assume them used in all cases. So, maybe we should just focus on multiboot2 loader only. In that case GR= UB2 should at first assume that BS regions are used. Then it should check image head= er. If it does not contain MULTIBOOT_TAG_TYPE_EFI_BS tag then starting from that po= int it should assume that BS regions are free and behave as it behaves right now. Howev= er, if multiboot2 loader encounters MULTIBOOT_TAG_TYPE_EFI_BS tag then it should still assu= me that BS regions are not free. Additionally, GRUB2 should not pass any memory map = info (i.e, MULTIBOOT_TAG_TYPE_BASIC_MEMINFO, MULTIBOOT_TAG_TYPE_MMAP, MULTIBOOT_TAG_= TYPE_EFI_MMAP, etc.) because they are bogus. In that case loaded image should take memor= y map itself using relevant BS calls. Does it make sense? Another questions is why grub_relocator_alloc_chunk_addr() does not consu= lt EFI memory map if grub_relocator_alloc_chunk_align() does. Should not we fix = it? Daniel