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

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


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 26 Jun 2023 13:24:59 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=75PuDGlVf5/qnqFXq4vjtQDZbcDiFxmbyDYQh2ee2Bk=; b=OvLlZYf2J/cWXLi+o8KI2fEROhOtlIfIIrtedVIptIY5qSPYbs6gBgD1wg4wR9I0iEg4Y1hcTBmMMgjZiduUVy+cB//uakd67qwzBkpj/mBHaGEeEdFSG9qWXIJEA24WEiWdUpenAmDB0IyBpp0bYEP9IJD8+Jxp2GVIdhCoYozGWDgijCVi8R5KHGNiKaEN07e6qKuxvwyA4mYc86z/Grx5K4ATt2e9BIcUtfp8gHd0Zw12Flx4Nh5xFWIZkyFCyvhfHLAdKOOG6ikfNDcYWvDoepLyAwXwpRCE3kG8cmkvGYr148o2y8LodyWky8IQFzquP9bm4+Cv6mED2gjLsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KoIlPHRpi6+aa3LbiXjXlSK0dc0qxd9OGAM88iYl5piptuhgJaqSW4BRz9WaghqqFHf20eqsrHXuh/bumPiKr9LUXTiwmGjPQE0O0W4OFyBWQJ3R9VLuEP5/taIfLOeaAN0XGFVLlYrOAGiOvHl7jvaewahr3j3Z1jTGTxWoXnAJrcZIjmQOscYGTfKC15K3Acnvxcpm6kjibMbC8XvVuMPhor2XYUCb4C7iobrMVTMsR48fYamN99cF0o1lq6fe4LzIpI+zjULKeiWTLtMVL1faZolJgO2e0gqBzn3YcAW5mHzkMQvMx/S8gUK1d5AkOnQ/Xc1k1LZkDWe0+/JOrQ==
  • Cc: <Luca.Fancellu@xxxxxxx>, <Henry.Wang@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 26 Jun 2023 11:25:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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.

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

~Michal



 


Rackspace

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