From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 5/4] xen: arm: ensure that the boot code is <4K in size Date: Fri, 18 Jul 2014 18:06:29 +0100 Message-ID: <53C95415.90009@citrix.com> References: <1405699899.6419.7.camel@kazak.uk.xensource.com> <1405702643.14973.5.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1405702643.14973.5.camel@kazak.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , xen-devel Cc: Stefano Stabellini , Julien Grall , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 18/07/14 17:57, Ian Campbell wrote: > This avoids having to deal with the 1:1 boot mapping crossing a > section or page boundary. > > Signed-off-by: Ian Campbell > --- > xen/arch/arm/arm32/head.S | 3 +++ > xen/arch/arm/arm64/head.S | 3 +++ > xen/arch/arm/xen.lds.S | 6 ++++++ > 3 files changed, 12 insertions(+) > > diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S > index caf7934..b4c3973 100644 > --- a/xen/arch/arm/arm32/head.S > +++ b/xen/arch/arm/arm32/head.S > @@ -458,6 +458,9 @@ fail: PRINT("- Boot failed -\r\n") > 1: wfe > b 1b > > +.globl _end_boot > +_end_boot: > + GLOBAL() should be in scope (although git grep shows that some use of .global has slipped back into the arm .S files) ~Andrew > /* Copy Xen to new location and switch TTBR > * r1:r0 ttbr > * r2 source address > diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S > index f28b74a..a52e2e4 100644 > --- a/xen/arch/arm/arm64/head.S > +++ b/xen/arch/arm/arm64/head.S > @@ -487,6 +487,9 @@ fail: PRINT("- Boot failed -\r\n") > 1: wfe > b 1b > > +.globl _end_boot > +_end_boot: > + > /* Copy Xen to new location and switch TTBR > * x0 ttbr > * x1 source address > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S > index be55dad..079e085 100644 > --- a/xen/arch/arm/xen.lds.S > +++ b/xen/arch/arm/xen.lds.S > @@ -178,3 +178,9 @@ SECTIONS > .stab.indexstr 0 : { *(.stab.indexstr) } > .comment 0 : { *(.comment) } > } > + > +/* > + * We require that Xen is loaded at a 4K boundary, so this ensures that any > + * code running on the boot time identity map cannot cross a section boundary. > + */ > +ASSERT( _end_boot - start <= PAGE_SIZE, "Boot code is larger than 4K")