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

Re: [PATCH 1/9] xen/arm: Check Xen size when linking



Hi Michal,

On 26/06/2023 12:24, Michal Orzel wrote:


On 25/06/2023 22:48, Julien Grall wrote:


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 reversed.
s/reversed/reserved


Signed-off-by: Julien Grall <julien@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 be58c2c39514..c5d8c6201423 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")
Would it be possible to use _start so that we can have a consolidated way of 
calculating xen size
across arch linker scripts and C code? It makes it easier for grepping.

Fair point. I have renamed to _start.


All in all,
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

Thanks!

Cheers,

--
Julien Grall



 


Rackspace

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