From nobody Thu Oct 23 00:06:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=arm.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1687750551385623.116780984926; Sun, 25 Jun 2023 20:35:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.554961.866461 (Exim 4.92) (envelope-from ) id 1qDd0e-0000Lw-J0; Mon, 26 Jun 2023 03:35:24 +0000 Received: by outflank-mailman (output) from mailman id 554961.866461; Mon, 26 Jun 2023 03:35:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDd0e-0000Lp-G6; Mon, 26 Jun 2023 03:35:24 +0000 Received: by outflank-mailman (input) for mailman id 554961; Mon, 26 Jun 2023 03:35:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDd0d-0000HH-Fg for xen-devel@lists.xenproject.org; Mon, 26 Jun 2023 03:35:23 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id 7963a96d-13d2-11ee-8611-37d641c3527e; Mon, 26 Jun 2023 05:35:19 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 388F41FB; Sun, 25 Jun 2023 20:36:03 -0700 (PDT) Received: from a011292.shanghai.arm.com (a011292.shanghai.arm.com [10.169.190.94]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C65593F64C; Sun, 25 Jun 2023 20:35:16 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7963a96d-13d2-11ee-8611-37d641c3527e From: Penny Zheng To: xen-devel@lists.xenproject.org Cc: Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Penny Zheng Subject: [PATCH v3 04/52] xen/arm: add .text.idmap in ld script for Xen identity map sections Date: Mon, 26 Jun 2023 11:33:55 +0800 Message-Id: <20230626033443.2943270-5-Penny.Zheng@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230626033443.2943270-1-Penny.Zheng@arm.com> References: <20230626033443.2943270-1-Penny.Zheng@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1687750553098100003 Content-Type: text/plain; charset="utf-8" From: Wei Chen Only the first 4KB of Xen image will be mapped as identity (PA =3D=3D VA). At the moment, Xen guarantees this by having everything that needs to be used in the identity mapping in .text.header section of head.S, and the size will be checked by _idmap_start and _idmap_end at link time if this fits in 4KB. In a later patch, we will move the MMU specific code out of head.S. Although we can add .text.header to the new file to guarantee all identity map code still in the first 4KB. However, the order of these two files on this 4KB depends on the build tools. Currently, we use the build tools to process the order of objs in the Makefile to ensure that head.S must be at the top. But if you change to another build tools, it might not be the same result. In this patch we introduce a new section named .text.idmap in the region between _idmap_start and _idmap_end. And in Xen link script, we force the .text.idmap contents to linked after .text.header. This will ensure code of head.S always be at the top of Xen binary. Signed-off-by: Wei Chen Signed-off-by: Penny Zheng --- v1 -> v2: 1. New patch. --- v3: 1. adapt to changes to "_end_boot" --- 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..4f7daa7dca 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -34,6 +34,7 @@ SECTIONS _stext =3D .; /* Text section */ _idmap_start =3D .; *(.text.header) + *(.text.idmap) _idmap_end =3D .; =20 *(.text.cold) --=20 2.25.1