From nobody Wed Dec 4 19:23:17 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1724430736; cv=pass; d=zohomail.com; s=zohoarc; b=cYYMWzlMsGbkemiuNtmn4ObDIFylqAEupZBODy2Dzg9AUSlc6q2ujRJcfJtxXmCSeE2s6uzat6xU562fmq1AQSBdynKRIaKECSU2e8YzgNiOnOYsj4xf2xIE7bDoa1O8OCb2kZ1l8ZFN5Wi/eB5qhqHJzMLc8Toj0FE/PmMNUt4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724430736; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Nr9rHx3YRb1ioBThg6/mHfFwNo227Uz+gT46derpfBU=; b=Qd3h8pkQ88B7HzY1poUBfJaeGk4vKitIbA99L8stGssudN3UlwCvNez1TLm7HAvYmVjMM2zOpVhxTBX26FFLE5nj80ZpLO2RhCMY980fg9XSWGMEnxq4KHDZuwngNWJHP2HGdBDx5YSSLNVSQ80WSP9av5jjpF6weWej0ClKHDA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; 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; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1724430736411310.9151943643586; Fri, 23 Aug 2024 09:32:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.782452.1191961 (Exim 4.92) (envelope-from ) id 1shXCh-0004LZ-BL; Fri, 23 Aug 2024 16:31:59 +0000 Received: by outflank-mailman (output) from mailman id 782452.1191961; Fri, 23 Aug 2024 16:31:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1shXCh-0004K3-6O; Fri, 23 Aug 2024 16:31:59 +0000 Received: by outflank-mailman (input) for mailman id 782452; Fri, 23 Aug 2024 16:31:57 +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 1shXCf-0003wy-Rl for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:31:57 +0000 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20615.outbound.protection.outlook.com [2a01:111:f403:2405::615]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3528e294-616d-11ef-8776-851b0ebba9a2; Fri, 23 Aug 2024 18:31:56 +0200 (CEST) Received: from SJ0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:a03:33a::6) by PH7PR12MB6812.namprd12.prod.outlook.com (2603:10b6:510:1b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 23 Aug 2024 16:31:49 +0000 Received: from SJ1PEPF000023CF.namprd02.prod.outlook.com (2603:10b6:a03:33a:cafe::7b) by SJ0PR03CA0001.outlook.office365.com (2603:10b6:a03:33a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend Transport; Fri, 23 Aug 2024 16:31:49 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF000023CF.mail.protection.outlook.com (10.167.244.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:47 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug 2024 11:31:46 -0500 Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 23 Aug 2024 11:31:45 -0500 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: 3528e294-616d-11ef-8776-851b0ebba9a2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YJSwoZ3cPZbUFIfJrMhDAY1/QmBfUBRHnoNeXNCtgXjdexP0SqcYudYe4f5GNwK3bYKsyOq1CgqJdJLIiHnan90h+MyRqiPJa1Yw/3JGyKZ02i/Bf+but8Bc4Jh98PYb3dgF6t785xDVmf0Rt2fAtxnqxXf4CIPuBIFw0s6c2KMUHPoapcJ8b6oOxyEHzmr6loc38pVwJgJkuj+UvzXZb+uSFrhIC0IMASHx+hgTKj0t8XR5G4MORe5TpTZ/u5KhBfC1CrpM3G2baS1lcUhMVCgFrV/y9xm8FCfNBI8PbHeFldHM4pV41QZXLUdA8IjzAECEcgbPrS8plkA0HS9F1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Nr9rHx3YRb1ioBThg6/mHfFwNo227Uz+gT46derpfBU=; b=Tw6qrhOghLPL/11ZTNK3O3EZG8tXpLKpKz8d/DuSN0vTTsi7XqTbV32U3yRwfZtLsOh+gwcxgyLxExiB11YvyOP/fr458ZUtaa9leICX00E6QNoxx70h+FcpMm/EyE1qUEX6UB8GZoKd+CNxnc0QXqDK383XDuoXuax6EBeIgvqFSM7nyCGOblosOSVugMDw95ky/mgHmR/RXrnhle9kd7t1tfksaQ96gY4rXj7P/cU7UX2E5H2xJzoWif+7+tJg8Yr3wfnlxSw4M7XllwRCItWGKdyPhuuOxkSP4skmxfXHinTxU2Hv2ZQ7jxQ8Op0irHDh14A7UvtXHpW/8b7BPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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 (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Nr9rHx3YRb1ioBThg6/mHfFwNo227Uz+gT46derpfBU=; b=UDW4zK9cjOI1y66eux3xmcnKQFFN4X8YpA44YDAzUw8v4/ZINiRj5r7TAB4eLhYD6SvOVLRMe4+rm+tIXiLwhoyLcVNpQZCXtJ0bVRp9G8mR+RLhp5Bq2iaCCSNeDEwsD449ZRMyKIe7rqzxLBckYQKI27XDBerE+2tr1r8q2ZQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; 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; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Ayan Kumar Halder To: CC: Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , "Jiamei . Xie" , "Ayan Kumar Halder" Subject: [PATCH v1 2/4] xen/arm: mpu: Define Xen start address for MPU systems Date: Fri, 23 Aug 2024 17:31:25 +0100 Message-ID: <20240823163127.3443404-3-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823163127.3443404-1-ayan.kumar.halder@amd.com> References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CF:EE_|PH7PR12MB6812:EE_ X-MS-Office365-Filtering-Correlation-Id: a5601d19-ca2f-46f3-d9a5-08dcc3911580 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ARmCeBXfk6QRFpEG4jk0AIjOUPHmrXb0p+E30Mj7a1K2tFxRiJtMQ/3MD9dJ?= =?us-ascii?Q?fF8QDWR69s+cBuSpyloRiCAB8TMkcClsPpplcL7lykHYjRTFX9cwqP6FDuUr?= =?us-ascii?Q?F1w447t/1KUktXFjsNJkHXfY5Oattz9FsFLT0CgqrgTWaiT63bCscLG0VetV?= =?us-ascii?Q?33RFdNoJpIjM96gA188aKYpAYhWyQqx19ZdQ+U8BFc52QGsFyaUwuoCPADom?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mqwzNf4PFcXcE9xJ5/xQ4+j?= =?us-ascii?Q?kQubf8a51oqmcCRTtf8h9hAl3A0HGSFM0/InrQax5qafTYO2eCu+9i7E/UQz?= =?us-ascii?Q?r3N5YYpbZve75gcbqwxj1hxTYHcwrox1HDPp9FF/15bCnDt/9gxEwENNc4Lr?= =?us-ascii?Q?/wmIq8x9VtVOwQ1tVOG5FXRvJXiPVvDmFWqiFOA3Vvkvb1YqfEEPLmQmJOdG?= =?us-ascii?Q?dAI4wYGd+dL7Np2EYnpChsVMHGeF3Kasm64Etyjp/1GisKCqnkgginyNJ+0N?= =?us-ascii?Q?uq24XozqtUoa2R+zmKWg+SUaMPzp9hbBSZPSDzhcglSwvfLiAI+amaz+cPnf?= =?us-ascii?Q?bdaYP/bB4nfESq29pQgP7FOZs57hLL1/?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:47.6645 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5601d19-ca2f-46f3-d9a5-08dcc3911580 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023CF.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6812 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1724430738085116600 Content-Type: text/plain; charset="utf-8" From: Wei Chen On Armv8-A, Xen has a fixed virtual start address (link address too) for all Armv8-A platforms. In an MMU based system, Xen can map its loaded address to this virtual start address. So, on Armv8-A platforms, the Xen start address does not need to be configurable. But on Armv8-R platforms, there is no MMU to map loaded address to a fixed virtual address and different platforms will have very different address space layout. So Xen cannot use a fixed physical address on MPU based system and need to have it configurable. So in this patch, we reuse the existing arm/platforms to store Armv8-R platforms' parameters. And `XEN_START_ADDRESS` is one kind of MPU based platform's parameters. So we define default `XEN_START_ADDRESS` in the MPU specific header file. We also introduce one Kconfig option for users to override the default Xen start address of selected platform, if they think the default address doesn't suit their scenarios. For this Kconfig option, we use an unaligned address "0xffffffff" as the default value to indicate that users haven't used a customized Xen start address. Signed-off-by: Wei Chen Signed-off-by: Jiamei.Xie Signed-off-by: Ayan Kumar Halder --- xen/arch/arm/Kconfig | 11 +++++++++++ xen/arch/arm/include/asm/mpu/layout.h | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 xen/arch/arm/include/asm/mpu/layout.h diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 686948cefd..d722ca690c 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -23,6 +23,17 @@ config ARCH_DEFCONFIG default "arch/arm/configs/arm32_defconfig" if ARM_32 default "arch/arm/configs/arm64_defconfig" if ARM_64 =20 +config XEN_START_ADDRESS + hex "Xen start address: keep default to use platform defined address" + default 0xFFFFFFFF + depends on MPU + help + This option is allowed to set customized address at which Xen will be + linked on MPU systems. This address must be aligned to a page size. + Use 0xFFFFFFFF as the default value to indicate that user hasn't + customized this address, and Xen use use the default value that has + been defined in platform files. + menu "Architecture Features" =20 choice diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/a= sm/mpu/layout.h new file mode 100644 index 0000000000..82a74b8b5b --- /dev/null +++ b/xen/arch/arm/include/asm/mpu/layout.h @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * config_mpu.h: A Linux-style configuration list for Arm MPU systems, + * only can be included by config.h + */ + +#ifndef __ARM_CONFIG_MPU_H__ +#define __ARM_CONFIG_MPU_H__ + + +#define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS + +/* + * All MPU platforms need to provide a XEN_START_ADDRESS for linker. This + * address indicates where Xen image will be loaded and run from. This + * address must be aligned to a PAGE_SIZE. + */ +#if (XEN_START_ADDRESS % PAGE_SIZE) !=3D 0 +#error "XEN_START_ADDRESS must be aligned to PAGE_SIZE" +#endif + +#define XEN_VIRT_START _AT(paddr_t, XEN_START_ADDRESS) + +#endif /* __ARM_CONFIG_MPU_H__ */ + --=20 2.25.1