[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/arm: Check Xen size when linking



commit 02a11313cdc60d266d8613899fcc9d3870ef5164
Author:     Julien Grall <julien@xxxxxxx>
AuthorDate: Thu Jun 29 20:44:17 2023 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Jun 29 20:58:09 2023 +0100

    xen/arm: Check Xen size when linking
    
    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@xxxxxxx>
    Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
    Tested-by: Henry Wang <Henry.Wang@xxxxxxx>
---
 xen/arch/arm/xen.lds.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index be58c2c395..d36b67708a 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -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")
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.