Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZQG7E-0005EV-LU for mharc-grub-devel@gnu.org; Fri, 14 Aug 2015 10:37:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQG7C-0005EN-AI for grub-devel@gnu.org; Fri, 14 Aug 2015 10:37:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQG79-0003LY-4P for grub-devel@gnu.org; Fri, 14 Aug 2015 10:37:50 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:25652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQG78-0003LO-U4 for grub-devel@gnu.org; Fri, 14 Aug 2015 10:37:47 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7EEbbo4025381 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 14 Aug 2015 14:37:38 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t7EEbawS018132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 14 Aug 2015 14:37:37 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t7EEbaFL027671; Fri, 14 Aug 2015 14:37:36 GMT Received: from olila.local.net-space.pl (/10.175.164.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 14 Aug 2015 07:37:36 -0700 Date: Fri, 14 Aug 2015 16:37:29 +0200 From: Daniel Kiper To: Jan Beulich Subject: Re: [Xen-devel] [PATCH v2 22/23] x86: make Xen early boot code relocatable Message-ID: <20150814143729.GE8034@olila.local.net-space.pl> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-23-git-send-email-daniel.kiper@oracle.com> <20150811164806.GB32231@l.oracle.com> <20150814115205.GA8034@olila.local.net-space.pl> <55CDFFEE020000780009B0B0@prv-mh.provo.novell.com> <20150814135904.GC8034@olila.local.net-space.pl> <55CE1805020000780009B1C0@prv-mh.provo.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55CE1805020000780009B1C0@prv-mh.provo.novell.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] 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: Juergen Gross , grub-devel@gnu.org, wei.liu2@citrix.com, 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, phcoder@gmail.com, xen-devel@lists.xenproject.org, qiaowei.ren@intel.com, keir@xen.org, 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, 14 Aug 2015 14:37:51 -0000 On Fri, Aug 14, 2015 at 08:32:05AM -0600, Jan Beulich wrote: > >>> On 14.08.15 at 15:59, wrote: > > On Fri, Aug 14, 2015 at 06:49:18AM -0600, Jan Beulich wrote: > >> >>> On 14.08.15 at 13:52, wrote: > >> > On Tue, Aug 11, 2015 at 12:48:06PM -0400, Konrad Rzeszutek Wilk wrote: > >> >> On Mon, Jul 20, 2015 at 04:29:17PM +0200, Daniel Kiper wrote: > >> >> > diff --git a/xen/include/asm-x86/page.h b/xen/include/asm-x86/page.h > >> >> > index 87b3341..27481ac 100644 > >> >> > --- a/xen/include/asm-x86/page.h > >> >> > +++ b/xen/include/asm-x86/page.h > >> >> > @@ -283,7 +283,7 @@ extern root_pgentry_t > > idle_pg_table[ROOT_PAGETABLE_ENTRIES]; > >> >> > extern l2_pgentry_t *compat_idle_pg_table_l2; > >> >> > extern unsigned int m2p_compat_vstart; > >> >> > extern l2_pgentry_t l2_xenmap[L2_PAGETABLE_ENTRIES], > >> >> > - l2_bootmap[L2_PAGETABLE_ENTRIES]; > >> >> > + l2_bootmap[4*L2_PAGETABLE_ENTRIES]; > >> >> > >> >> ? Why do we need to expand this to be 16kB? > >> > > >> > TBH, we need 8 KiB in the worst case. The worst case is when > >> > next GiB starts (e.g. 1 GiB ends and 2 GiB starts) in the middle > >> > of Xen image. In this situation we must hook up lower l2_bootmap > >> > table with lower l3_bootmap entry, higher l2_bootmap table with > >> > higher l3_bootmap entry and finally fill l2_bootmap relevant > >> > tables in proper way. Sadly, this method requires more calculations. > >> > To avoid that I have added 3 l2_bootmap tables and simply hook up > >> > one after another with relevant l3_bootmap entries. However, if > >> > you wish we can reduce number of l2_bootmap tables to two. This > >> > way code will be more complicated but we will save about 8 KiB. > >> > >> Wouldn't it be better (simpler) to enforce, say, 16Mb alignment > >> in the PE32+ header (which the EFI loader would then honor)? > > > > Good idea but then we must enforce this for multiboot protocol (v1 and v2) > > too. > > multiboot2 with my patches supports that solution. However, multiboot (v1) > > could > > be a bit problematic because it means that we must set load address to 16 > > MiB. > > Are we sure that this region is available on all machines like region > > starting > > at 1 MiB? > > "This region" being which one? 16 MiB - 32 MiB. Daniel