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 <jul...@xen.org>
> ---
> 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.
All in all,
Reviewed-by: Michal Orzel <michal.or...@amd.com>
~Michal