From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v2 22/23] x86: make Xen early boot code relocatable Date: Fri, 14 Aug 2015 08:32:05 -0600 Message-ID: <55CE1805020000780009B1C0__25198.538034647$1439562826$gmane$org@prv-mh.provo.novell.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZQG1j-0008HP-OC for xen-devel@lists.xenproject.org; Fri, 14 Aug 2015 14:32:11 +0000 In-Reply-To: <20150814135904.GC8034@olila.local.net-space.pl> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Daniel Kiper 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 List-Id: xen-devel@lists.xenproject.org >>> 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? Jan