]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/arm: Check Xen size when linking
authorJulien Grall <julien@xen.org>
Thu, 29 Jun 2023 19:44:17 +0000 (20:44 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 29 Jun 2023 19:58:09 +0000 (20:58 +0100)
The linker will happily link Xen if it is bigger than what we can handle
(e.g 2MB). This will result to unexpected failure after boot.

This unexpected failure can be prevented by forbidding linking if Xen is
bigger than the area we reserved.

Signed-off-by: Julien Grall <julien@xen.org>
Reviewed-by: Henry Wang <Henry.Wang@arm.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Tested-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/arm/xen.lds.S

index be58c2c395147992868a332cf3ffda21aa92387f..d36b67708ab11a8d8dc1b04294e8b751feff9c69 100644 (file)
@@ -241,3 +241,4 @@ ASSERT(IS_ALIGNED(__init_begin,     4), "__init_begin is misaligned")
 ASSERT(IS_ALIGNED(__init_end,       4), "__init_end is misaligned")
 ASSERT(IS_ALIGNED(__bss_start,      POINTER_ALIGN), "__bss_start is misaligned")
 ASSERT(IS_ALIGNED(__bss_end,        POINTER_ALIGN), "__bss_end is misaligned")
+ASSERT((_end - _start) <= XEN_VIRT_SIZE, "Xen is too big")