xen: arm: ensure that the boot code is <4K in size
authorIan Campbell <ian.campbell@citrix.com>
Mon, 21 Jul 2014 12:59:59 +0000 (13:59 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 24 Jul 2014 15:23:17 +0000 (16:23 +0100)
This avoids having to deal with the 1:1 boot mapping crossing a
section or page boundary.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S
xen/arch/arm/xen.lds.S

index 0a95b68b568ff1cd8456e818c824c2e383d4425d..2547ce1d6d8ea043789ab05b486b058193485bab 100644 (file)
@@ -457,6 +457,8 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
+GLOBAL(_end_boot)
+
 /* Copy Xen to new location and switch TTBR
  * r1:r0       ttbr
  * r2          source address
index 4f0ea2dca251e4370e168e5cb980251129b132cf..b71b6f081202fa84d328bf68ca13c3d83fcecc04 100644 (file)
@@ -487,6 +487,8 @@ fail:   PRINT("- Boot failed -\r\n")
 1:      wfe
         b     1b
 
+GLOBAL(_end_boot)
+
 /* Copy Xen to new location and switch TTBR
  * x0    ttbr
  * x1    source address
index be55dad4daa5db7636cc5737f35a774ebf56227a..079e0851c76e11f833ad1003fab3c279963dd7bd 100644 (file)
@@ -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")