From nobody Thu Nov 21 19:58:06 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=1723569271; cv=pass; d=zohomail.com; s=zohoarc; b=cFkgzSvkef7AAHmczLjLQAotoSTJsTeUp7ccqE9QzJt9VKJ7DTR2ZEScbwcIxq9MSW0Fj8WwE30/85oiIubEOVvCli6A9ZHEQ2OO/n86LUWrLdGj7fWD8CrOPCmWuK1ERX8cKqN69JAyEn//S2XwtnW+fG0s6nEsUPNHCnEh4E4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723569271; 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=GExeTyZpqmeGMzyUHWrGW/i414l2COxtQTsLu5JBV2E=; b=mv9rei/zUQHlx2q8enXlQ0Zbl0U05YvSAxW9FXdoR88WVZ1lxgw69nqiRQmUvlO5flS4A8l2918AZLQ6QqBVfp95hmKhe+xeO46d4lbSFK6B65K35JEPVTcXE0rLbE9HEJVJVmFnYzrWi8EybV+B9frEyNNoJ+yvWKsVQjAxFYA= 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 1723569271949885.1417274752423; Tue, 13 Aug 2024 10:14:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.776485.1186648 (Exim 4.92) (envelope-from ) id 1sdv69-0007ak-KV; Tue, 13 Aug 2024 17:14:17 +0000 Received: by outflank-mailman (output) from mailman id 776485.1186648; Tue, 13 Aug 2024 17:14:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv69-0007ad-HY; Tue, 13 Aug 2024 17:14:17 +0000 Received: by outflank-mailman (input) for mailman id 776485; Tue, 13 Aug 2024 17:14:15 +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 1sdv67-0007Zn-QD for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:15 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060c.outbound.protection.outlook.com [2a01:111:f403:2418::60c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 75cc493a-5997-11ef-8776-851b0ebba9a2; Tue, 13 Aug 2024 19:14:13 +0200 (CEST) Received: from BN0PR04CA0074.namprd04.prod.outlook.com (2603:10b6:408:ea::19) by SA1PR12MB8988.namprd12.prod.outlook.com (2603:10b6:806:38e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug 2024 17:14:08 +0000 Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com (2603:10b6:408:ea:cafe::3e) by BN0PR04CA0074.outlook.office365.com (2603:10b6:408:ea::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 17:14:07 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:07 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:14:05 -0500 Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 13 Aug 2024 12:14:04 -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: 75cc493a-5997-11ef-8776-851b0ebba9a2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TnB88TVG1wAJSbR3kgkN+4E6krQLOT5mgZ+ZNXukmgfyFe1ncuFA0JpvQg8ANUsckJO8o2i+Lh72MVDe9YXT1AnZ9lRQ7tpONzdrqtwFMYeMf0EYjVZafdsyUUSGDRFXONdfUiROMQ76UqcrBmbH7Deb3ve1l7xJlRwXH4hhEfYrI9W2vHGE9lDGvDE1eA+2OPnn9fitT2s4E578kvrWpyj9UkKIcpIHCizGZ040z85bHZ8kXHHdKqlfGC867qxGihuMili1iouyHdqSTDWWf4cTDtztfyH/xvd7GvkiefTlWlF++yaNuGgRwRF4/l7YlrjOCpPOf5/V3dTIrOh36A== 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=GExeTyZpqmeGMzyUHWrGW/i414l2COxtQTsLu5JBV2E=; b=ocntKJiLjyUr+JnSd5hqJgkbrrsDTJ7qNIOAGmx3RErVrhu2CVAb0VM96+zIzducStVuYi94S4Rgk/zSZoG7MBa4xVAU3s7M/v8JyrlD6GaRrkgzEnNCcQc2CgwkjTO7XdheQdUQ923kWCfFaSQVqo7dbL/5ZlvjGYpumoZXodiDy/LU+cpFyVJ0enBHbQ9GZx0ER78IsZnfEnNRVWObZVoT69FN3i4nAJ5Dyxa4BiyJuhHq1CK9jvphOwbh1oVU0e+BCAuXs01bkx7zmF0RK5uA8oLvrIN8no5tqfU3Hvxa+38qH+AhzbESNJwyMttJ4hfNEW+5Zi1OdnxENF4oGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=GExeTyZpqmeGMzyUHWrGW/i414l2COxtQTsLu5JBV2E=; b=Fz+zX/gh6RJHOdXYA7B1u4WTJYP8CTiGTvBVZ4yhtAJDf0KyHp2G6/bBRCx47rOWEYC+9B3gVFOoQszra4ty3IsDfFPENosaDFG5IDD+am362b2Qo8QqvcmbW6fgY5+VK6RvQPwmy3Atq73XZymE68WKXrZ+WpuRNxdxVYlLrhs= 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=SATLEXMB03.amd.com; pr=C From: Ayan Kumar Halder To: , , , , , , CC: Subject: [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping() Date: Tue, 13 Aug 2024 18:13:53 +0100 Message-ID: <20240813171356.46760-2-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com> References: <20240813171356.46760-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|SA1PR12MB8988:EE_ X-MS-Office365-Filtering-Correlation-Id: b4587ca2-d72a-4139-0076-08dcbbbb5733 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fbNwL5IKGHiu8quXXxlV3ux/ZxBEMDn9R6OMNo+eJpj2X3ynvn/zHENB/Yc0?= =?us-ascii?Q?ltL8eYuAlgT3x5oVA/suqgCVGKQmBL+ml5qOrOmQOn8wd6FmU/kVuqPofb0+?= =?us-ascii?Q?ikjZSPzvpI8HFlf5iNAGonbOgWwYLSPsdqh2l82B4Fp4NvfSG6NXEl7NreST?= =?us-ascii?Q?o+ItZEvGBQquKPEBEmhZRLpTdO0OYYaVZZVch77ncfhpkc0xZYktwGLSAsyH?= =?us-ascii?Q?FORgjyHVTCDWccWM6py4Bv0296R6S8jWoBjz9JUoCgD17I3r//EWJCGVkXbU?= =?us-ascii?Q?e98ZeKVGCLnEzLRwL14g3nFtfhhzQoErnDvqZFHQNosJ2GMIPlUBdR+r7G35?= =?us-ascii?Q?/K+GiMH2T4QxIpGs2Vbu3/9fAvB1xjiy9oXQhynwfYP4WkhEiMg6qvuOgQRJ?= =?us-ascii?Q?z4swakWNBbEKUdGxHM/Tp5ujsa9HKaWgXiiX/7jbpgL8TQ6Zf8eCtc3uGjHl?= =?us-ascii?Q?nH0Sf6EXtDhMXRGHlULgoYJ8Nbn9gM5aB/F30kzvRHUB9V6aUtzrT8+bG7Tq?= =?us-ascii?Q?oeuRqJfsCuSAH5jV7YRZZCdO6Nnvk5m1pjTkPeSxPvFBN6EMjZbD3weJoJyy?= =?us-ascii?Q?oq5rCM97ryv0gLzTX6R5PxCrffruu6ELGINapAIf+Vc6Zv1/ak2NSrrh+QPI?= =?us-ascii?Q?wsJlVNc1jr8DdC6AgSkoqGEtUziqNUCLijkU3l0sjOJ/usNhLrZSABdt7hSZ?= =?us-ascii?Q?xYRNy+HPZE1jC9sPZ9wLR5ikEDJkpR1qKvC96Gk6PEFLODHvWSnOt0l6I0K3?= =?us-ascii?Q?76x+Ww/pvLvuXqXmFZK9bDc5Pixuz8XzjLguJfJqRcO9R0GjsyjJPzqxyfVh?= =?us-ascii?Q?F6VMPfi7Pwluhqkiu4pSEgKxmM3fmUUSO6kTmAvNBdPafbinjItAtm+DrAcA?= =?us-ascii?Q?E0ENP9/G6XiZvRF84JvQQQX2N3uKd7SSwa4hI/VPMcJ1Dl2eArof3S8Gcigl?= =?us-ascii?Q?DfEgJdsSbIv/PvgIy0s7U03dW5DMAG0mDHzoyi80bdnxNB1m3tLNBLylquZi?= =?us-ascii?Q?JUPpHGnL+s+l8hW/WJfqO1vf+jljUAGzjWxNQeMfTVmdd930JBSIWNh1NNDz?= =?us-ascii?Q?OfVXE7EAlHYdNZKigeLOluw9H6kYSljVAjZmuScwhAIcEC6fCyxoR2fVSIzx?= =?us-ascii?Q?8ZVVUy84/0LPTJyRoUxfmEmXfiqkhqI0BWoGOLepyBldlaJxYig87H8ShZb8?= =?us-ascii?Q?ATy2fEyqmAp8Ea9o0pFjyAnlr4nUvEz4Zr2JAElOoasyFoQxPrNjSrSGyQgD?= =?us-ascii?Q?CFKlk9Pj+fbaNDs9Q40T+bj6VBwgahHPF/a/sZ+HT8tBw9BRfALb/HZqtt6c?= =?us-ascii?Q?i8TcKGS+i9hAKtXIKG9LKiICo0v3adh2hwdhgvQcIjWdW650SuEMluGagU6U?= =?us-ascii?Q?RVq6vwWyHCjTK45/+QgcnyqhKad6sLa9bxYgipr83p0UWjjdmg=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:07.5381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4587ca2-d72a-4139-0076-08dcbbbb5733 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECDA.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8988 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723569272861116600 Content-Type: text/plain; charset="utf-8" update_boot_mapping() invokes update_identity_mapping() for the MMU specific code. Later when the MPU code is added, update_boot_mapping() would invoke the equivalent. The common code now invokes update_boot_mapping() instead of update_identity_mapping(). So, that there is clear abstraction between the common and MMU/MPU specific logic. This is in continuation to commit f661a20aa880: "Extract MMU-specific MM code". update_identity_mapping() is now marked as static as it is called within xen/arch/arm/arm64/mmu/mm.c only. Also, updated the prototype to update_boot_mapping() which is now invoked from other files. Signed-off-by: Ayan Kumar Halder Reviewed-by: Michal Orzel --- Changes from :- v1 - 1. Introduced update_boot_mapping() which invokes update_identity_mapping() in MMU specific code. v2 - 1. Make update_identity_mapping() static and update the prototype. xen/arch/arm/arm64/mmu/mm.c | 7 ++++++- xen/arch/arm/arm64/smpboot.c | 6 +++--- xen/arch/arm/include/asm/arm64/mm.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c index 293acb67e0..1afbbeda5a 100644 --- a/xen/arch/arm/arm64/mmu/mm.c +++ b/xen/arch/arm/arm64/mmu/mm.c @@ -111,7 +111,7 @@ void __init arch_setup_page_tables(void) prepare_runtime_identity_mapping(); } =20 -void update_identity_mapping(bool enable) +static void update_identity_mapping(bool enable) { paddr_t id_addr =3D virt_to_maddr(_start); int rc; @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable) BUG_ON(rc); } =20 +void update_boot_mapping(bool enable) +{ + update_identity_mapping(enable); +} + extern void switch_ttbr_id(uint64_t ttbr); =20 typedef void (switch_ttbr_fn)(uint64_t ttbr); diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c index a225fae64d..789f352ab6 100644 --- a/xen/arch/arm/arm64/smpboot.c +++ b/xen/arch/arm/arm64/smpboot.c @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu) if ( !smp_enable_ops[cpu].prepare_cpu ) return -ENODEV; =20 - update_identity_mapping(true); + update_boot_mapping(true); =20 rc =3D smp_enable_ops[cpu].prepare_cpu(cpu); if ( rc ) - update_identity_mapping(false); + update_boot_mapping(false); =20 return rc; } =20 void arch_cpu_up_finish(void) { - update_identity_mapping(false); + update_boot_mapping(false); } =20 /* diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm= /arm64/mm.h index e0bd23a6ed..ac8d1f5c78 100644 --- a/xen/arch/arm/include/asm/arm64/mm.h +++ b/xen/arch/arm/include/asm/arm64/mm.h @@ -21,7 +21,7 @@ void arch_setup_page_tables(void); * Note that nested call (e.g. enable=3Dtrue, enable=3Dtrue) is not * supported. */ -void update_identity_mapping(bool enable); +void update_boot_mapping(bool enable); =20 #endif /* __ARM_ARM64_MM_H__ */ =20 --=20 2.25.1 From nobody Thu Nov 21 19:58:06 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=1723569277; cv=pass; d=zohomail.com; s=zohoarc; b=UweRNZFD4HzkuJYBAqEnvLcxneo45SubvO0zR5yZxBGhOygA2P5lwQ/c5WwZOcKIB003wxw0tpZleio8UMmX2JJLd6XWLrCgMt9t89rVzzcDLaMJHq2u1b2OWe+jmDp24ch1mGKF3lWNFgOcjdVKVJZA6FvvupJPkUDqwdzgy6U= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723569277; 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=5t/nB18k33JmikWIsTZUH9Fi3nu8O21bDaKGSgVj5HY=; b=FmPnawTQsSd+2q//DpiIe0tK+tAODQZ+fxsDifTBdNMSjJvABJQkl1we5snDnljwaEBWEoo4KF9OVcvotSypjwN/RbJcs/Z37e72eC9U+Y+NfkQ/JKqOPZyvPqHYq4EJGTA8Qnf89cHXkqx0SoDHctUksn+PLlJukzYSiEoTqZs= 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 1723569277890201.51184531179115; Tue, 13 Aug 2024 10:14:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.776486.1186657 (Exim 4.92) (envelope-from ) id 1sdv6B-0007r7-Sc; Tue, 13 Aug 2024 17:14:19 +0000 Received: by outflank-mailman (output) from mailman id 776486.1186657; Tue, 13 Aug 2024 17:14:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6B-0007qw-PR; Tue, 13 Aug 2024 17:14:19 +0000 Received: by outflank-mailman (input) for mailman id 776486; Tue, 13 Aug 2024 17:14:18 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6A-0007JM-7z for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:18 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061e.outbound.protection.outlook.com [2a01:111:f403:2412::61e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 77edf91e-5997-11ef-a505-bb4a2ccca743; Tue, 13 Aug 2024 19:14:17 +0200 (CEST) Received: from CH0PR03CA0057.namprd03.prod.outlook.com (2603:10b6:610:b3::32) by SN7PR12MB6791.namprd12.prod.outlook.com (2603:10b6:806:268::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug 2024 17:14:10 +0000 Received: from CH1PEPF0000AD80.namprd04.prod.outlook.com (2603:10b6:610:b3:cafe::10) by CH0PR03CA0057.outlook.office365.com (2603:10b6:610:b3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend Transport; Tue, 13 Aug 2024 17:14:10 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000AD80.mail.protection.outlook.com (10.167.244.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:10 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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; Tue, 13 Aug 2024 12:14:09 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:14:09 -0500 Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 13 Aug 2024 12:14:07 -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: 77edf91e-5997-11ef-a505-bb4a2ccca743 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YCAyRdf3T9u/L9pQSSavjL4LC8u0F1E/Lt57eyCzxN09hL6ssS0Ls8kH9SCB3ruwyAifSJpIsN8bJw+OlhWQn8UZDM/iSw8qVCBV49FUoKyw+uxl0pxzeYy6LW4yLjc1PkAdIUU3LR+nkXYMeCpYhQ0EI3bDTr0akgH9EdSfckGo+V1+ayoQbGkVpQBKz4sD2cVtXJRF+eKigC1CLD7KQiO4OZyHAIv1YwOj1p8MB237oLcT0cIOAhsuHYDScUTVO/7ZutkOAnDTc/Xvni/NBJg3t+1VrgcgbWu3eDM3RiuQGq5H98Mr+XWH7kMFOtrHUquQd2rEmoas4Aof1g6NXQ== 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=5t/nB18k33JmikWIsTZUH9Fi3nu8O21bDaKGSgVj5HY=; b=W9u3LWuc1P2cqNLvApvRgU87/HsFAJOvNkl8a6zCAciISLZYkvWC+mr8gLDRAGXPEM/UEFnf3QD5jnjdxDAZpvl/vXQ4BIG6C8ELIZ/oKTS5rPcIrxoCFxuFTGDcxoyI54TI6ULGsybviILfEF+1X1tZUP688sSBsU68UxSh4XyBgxaSQg9yGbRECovabm1VasAdVliweORSEbb3wBRg4pNgr+tVC7gS91JSiCV/Boyqcy2JV9PNhxqselKnJ+PG5mHmNlID0oRNMejLsQJcOIdDvKzV8xaMTyDHsA3zwROC/RSxNwYFkcBxz6jnNfqq8wayNTKt2J0gO9KESxZVeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=5t/nB18k33JmikWIsTZUH9Fi3nu8O21bDaKGSgVj5HY=; b=LlLAA4L29tPB1d3hoELRaLuLwJQxhNOIFQ0PR0LzYBqU7OHFLKF5VER2NY+aRqKfTRl5GLv/rdfJLZ1H9LvRqAKm6orClvRPliayN+/VNcs1QwGBoNN2tJ33OvzQc9918+BKRR/j6Ily3rhpxgpPAyV5Z3VsJyFbt3U/ptOt59w= 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: , Penny Zheng , "Wei Chen" Subject: [PATCH v3 2/4] xen: make VMAP only support in MMU system Date: Tue, 13 Aug 2024 18:13:54 +0100 Message-ID: <20240813171356.46760-3-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com> References: <20240813171356.46760-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD80:EE_|SN7PR12MB6791:EE_ X-MS-Office365-Filtering-Correlation-Id: 554ff9d2-33f5-4a54-ccdb-08dcbbbb58d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aLcuU0YyPYlq67p48ejlMr/PmVKoXUeEu/ME9g00DeNX8PE9AkPD40vewb6f?= =?us-ascii?Q?KVfI0KUf4QziX5f5imAZk6b9Pzpv1SLdMNSOGojlrHkn+/IbVXCanAJoEdQI?= =?us-ascii?Q?sLrFX3yUScL1X+wFWPnKugMpBLIGG9rstLttLlgIvtpZ39aYqoqGXAxRGDZs?= =?us-ascii?Q?jK6GHAUyWgH00n8vcD2dPUAmkHTSXwp6mDapvMhNxV6zXo8mfy1mWHVYmbfg?= =?us-ascii?Q?1aFZGwSgUyl98Zk4JUsHdrN7iiT0AhThqdFNcXPtcD3rynGR2eOt1S9kMw9W?= =?us-ascii?Q?7/q1SeRx1ZZW9UxLYgFwyr79JfsS9LirAuEurAA7nBFZJ+zHIp3uz22mR2UO?= =?us-ascii?Q?103dWrt8wB17YdNOeBK9yhjAUUVCW2uX+UIMLWa7D/74xM7sJ8DS/xzW/jnG?= =?us-ascii?Q?yJZoOF0anqZVCZj9ccOLmWWJp0HiA9J1Xpc07ZwTgrqmFNfoGBw7TiyrfCdY?= =?us-ascii?Q?kNq0wYls12yleWek8OUzMF//OTZI0fEog5zUXNwU60dArKUeOEOEbr4GsO2S?= =?us-ascii?Q?Vo370TQZzTPaHsGTBo1SzBdhtBhTuFXYdSlVOcNEW/RwtGd6yef5sGI4n+pe?= =?us-ascii?Q?bfbgTFkuMWJ41mTRAkCz0HSz7YsO1fdJpReeua4ChxsIgZqZkKdlDxjk/Y+/?= =?us-ascii?Q?8/Sfo4WMgV1zV9qT1g3/3gMiMjr6Tty3DGZbY7jWQM58V8gwMHOKc6VBPfiD?= =?us-ascii?Q?YT5XcuD3mHG43eBKZHxvvIznzWm+k5/Jy1Q0EMjhiABI92NJTJd2kNzi8IJ1?= =?us-ascii?Q?9v0145rZv3oEd//fqpdCzRekmtRMsXiUNzCDg+1zgsXUXQ0OnhjjhJotHHmF?= =?us-ascii?Q?QARiEw4B4Vpqh8zdGxhTZ82rEQCVYFSZmI4f5Y19buoZWAnkcdIveyvOzXxr?= =?us-ascii?Q?pocW5h6YYhPokxMxNCFhUa7CM1ZAPUECN3irxCjOOLzfZX2yzDCKTmifmMVW?= =?us-ascii?Q?gWI/kWCr2+t4c/UdNf46xn8X1M/OJz04n+66o/Mxu4baFvPGqpaUPcK2QHEW?= =?us-ascii?Q?Y0b1qPAwh1qKfh54czQoSV7LHhPbuYeGFpP0HLV08sqcPTpaOm6seeS+/H8B?= =?us-ascii?Q?Sfeot7/KN3rT83AVoK7M0CZxAyQGJfuvC5+WN522MGPSLFktRiJd2BY5Z7Nd?= =?us-ascii?Q?f2b4mpZJimxektPbJ8dD7zhhxJHEaA5pP+/fcZnUDU5gbaiIq/65GFhk/QtD?= =?us-ascii?Q?gMNmx45Zoljax9kWxKTK30IEx/zqYvEyBxglcwqmYoxOthpHoJIvzTwQ12Fa?= =?us-ascii?Q?3/pBYPvJPWLSMqW/CGyedBvBxLbgE3uKkkTJNBKnOXYqR1MhaJ/VlyOMO7jW?= =?us-ascii?Q?1jdzv4OfFCODKkHkMBSmXan14CD8KUwtlhRBqE6Q530hwGBEYyo7YHYPu58O?= =?us-ascii?Q?ZpE5rIyo2I5sFsQLLLFIq5d14CM47CbynEOAVz1gFFPO4EnzRQ=3D=3D?= 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)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:10.2580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 554ff9d2-33f5-4a54-ccdb-08dcbbbb58d6 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: CH1PEPF0000AD80.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6791 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723569279013116600 Content-Type: text/plain; charset="utf-8" From: Penny Zheng Introduced CONFIG_VMAP which is selected by the architectures that use MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled. VMAP is widely used in ALTERNATIVE feature to remap a range of memory with new memory attributes. Since this is highly dependent on virtual address translation, we choose to fold VMAP in MMU system. In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it only support in MMU system on ARM architecture. And ALTERNATIVE now depends on VMAP. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative attacks are not possible on non MMU based systems (ie Cortex-R52, R82). See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Process= or%20Vulnerability. Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Ayan Kumar Halder --- Changes from :- v1 - 1. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP. 2. cpuerrata.c is not gated on HAS_VMAP. v2 - 1. Introduced CONFIG_VMAP in common/Kconfig. 2. Architectures using MMU select this config. 3. vm_init() now uses CONFIG_VMAP. xen/arch/arm/Kconfig | 4 +++- xen/arch/arm/setup.c | 2 ++ xen/arch/x86/Kconfig | 2 ++ xen/common/Kconfig | 3 +++ xen/include/xen/vmap.h | 2 ++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 21d03d9f44..e30a7da186 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -12,7 +12,7 @@ config ARM_64 config ARM def_bool y select FUNCTION_ALIGNMENT_4B - select HAS_ALTERNATIVE + select HAS_ALTERNATIVE if HAS_VMAP select HAS_DEVICE_TREE select HAS_PASSTHROUGH select HAS_UBSAN @@ -61,6 +61,7 @@ config PADDR_BITS config MMU def_bool y select HAS_PMAP + select HAS_VMAP =20 source "arch/Kconfig" =20 @@ -171,6 +172,7 @@ config ARM_SSBD =20 config HARDEN_BRANCH_PREDICTOR bool "Harden the branch predictor against aliasing attacks" if EXPERT + depends on HAS_VMAP default y help Speculation attacks against some high-performance processors rely on diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index cb2c0a16b8..7f686d2cca 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -447,7 +447,9 @@ void asmlinkage __init start_xen(unsigned long boot_phy= s_offset, * It needs to be called after do_initcalls to be able to use * stop_machine (tasklets initialized via an initcall). */ +#ifdef CONFIG_HAS_ALTERNATIVE apply_alternatives_all(); +#endif enable_errata_workarounds(); enable_cpu_features(); =20 diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 7ef5c8bc48..32be057978 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -1,6 +1,7 @@ config X86_64 def_bool y select 64BIT + select HAS_VMAP =20 config X86 def_bool y @@ -31,6 +32,7 @@ config X86 select HAS_UBSAN select HAS_VPCI if HVM select NEEDS_LIBELF + select HAS_VMAP =20 config ARCH_DEFCONFIG string diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 565ceda741..188918ec5c 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -77,6 +77,9 @@ config HAS_PIRQ config HAS_PMAP bool =20 +config HAS_VMAP + bool + config HAS_SCHED_GRANULARITY bool =20 diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h index fdae37e950..c1dd7ac22f 100644 --- a/xen/include/xen/vmap.h +++ b/xen/include/xen/vmap.h @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void); /* Initialises the VMAP_DEFAULT virtual range */ static inline void vm_init(void) { +#ifdef CONFIG_HAS_VMAP vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end= ()); +#endif } =20 #endif /* __XEN_VMAP_H__ */ --=20 2.25.1 From nobody Thu Nov 21 19:58:06 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=1723569296; cv=pass; d=zohomail.com; s=zohoarc; b=gEMiDmW0q4BNIbJOG7rfU1rkRyoDzIpuC1QWwbkTBLqYECZFC1TXqx+/3zLvOAbVm5BgLtrtHWdkIYhY2jt247jpZ0GcvzeHB4A2Q35HqREdBXGqJmv128sbaFTImIksO7RXXbXYk45a45ox+K1/oqIOQ5SQtjuCGs4xHqFZ/sI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723569296; 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=Iv/mcdKWSyDFQyeXlKdWpa5s6Ph01vN5ht4yXXGmCFM=; b=A98/B3dtnwJP222OemqpuPv5jkWfkG8LbEYuf+rHGymWGAHqUa8vxgzq2jCzpc7Bmd2NqqZ5RR3wys60G7zzJ/qYAPAI3HTOyaOYcfooIa5XIAVRPrro2X4AS1LXZDVjQW56rzCEFA6LnqpA/NUPn875JeQXcueserpruSBBeiI= 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 1723569296512455.51327840007787; Tue, 13 Aug 2024 10:14:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.776504.1186668 (Exim 4.92) (envelope-from ) id 1sdv6c-0000Lk-4C; Tue, 13 Aug 2024 17:14:46 +0000 Received: by outflank-mailman (output) from mailman id 776504.1186668; Tue, 13 Aug 2024 17:14:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6c-0000Ld-1J; Tue, 13 Aug 2024 17:14:46 +0000 Received: by outflank-mailman (input) for mailman id 776504; Tue, 13 Aug 2024 17:14:45 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6b-0007JM-3g for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:45 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20601.outbound.protection.outlook.com [2a01:111:f403:2009::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 87d21fa2-5997-11ef-a505-bb4a2ccca743; Tue, 13 Aug 2024 19:14:44 +0200 (CEST) Received: from MN2PR22CA0017.namprd22.prod.outlook.com (2603:10b6:208:238::22) by IA1PR12MB6162.namprd12.prod.outlook.com (2603:10b6:208:3ea::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug 2024 17:14:38 +0000 Received: from MN1PEPF0000ECD8.namprd02.prod.outlook.com (2603:10b6:208:238:cafe::7d) by MN2PR22CA0017.outlook.office365.com (2603:10b6:208:238::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 17:14:38 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000ECD8.mail.protection.outlook.com (10.167.242.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:38 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:14:38 -0500 Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 13 Aug 2024 12:14:37 -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: 87d21fa2-5997-11ef-a505-bb4a2ccca743 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PSySvNV3VQ66/7hxddt4h+Q/o+jwuZhNjZzSqfXh2Eskf4RlDf7eB3d0TVIokVUOPtxV9TtSvdigmDe1xA6NM2WWvyxdzcbdi1g1abbItB+dtvuFD1wIs3OuC6JfKq8HAbBrQ6C8VsmbTELAXlG2JUgHzeFjn7EknNnDx6OF2+8fNpLtv2tWdQVcyvXpsBFDbWf3m0OpJPdOErwqZrieYeQ+69OxtQFnlKMU4KW9DIOYS1nVExuT5t+2aDgUUirbjdITNT9j5uK+GgdEQEe7db1nXFkegELnIgTjY+FOQmy5eLPdieOUYkUVqmjI7IUWYfmchdhlCjcsQjju6b2qKg== 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=Iv/mcdKWSyDFQyeXlKdWpa5s6Ph01vN5ht4yXXGmCFM=; b=vEXvWDv9ncWLuhLLbDt3bCQ+ypu8E9gGOpiTMfHT1CjtJ2Fxwe9H3D9rV+n7zaHN5ODcHfagtD3FETW9gwXACWOE4Ws+y8FKy8mmXm/IEW3L3nJCW8Q9XrkFh9kk0OcGGx8oe0TZBCsYZXtcbbNhobhQGq3qGRLyYhO40zQ6f+uFMzq9SOKdytseyt7A0SF+2NYXj4/xRt4mfGKmWkdFK1aGOfbG//gJPM4oQ1UjoMC4ZaH26ELEvQ1YGU5ubUFlPdUR6xM0riqZA0csnjV/+vHqe93uU3PwrbzgT2rabbGbSagOOHfuVXzsOBpmZ5YxpnUlCnyxzjprnqFmRSqXag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=Iv/mcdKWSyDFQyeXlKdWpa5s6Ph01vN5ht4yXXGmCFM=; b=KIizFa56O55nH0yBVEK0TfUAY5I9CPc/zXI/hDJzVGfGvcw0VpgerGsRvD4Nm9dAKi0ikhC4+v2Vaamz9ye5gmkwcQLrInvPrMOlaR4dao9t96wJDNURV6FCDjM0TXl7J58sOOV3DdomeiEiRSGA5tnvPlQFg53QdbpEVo8x0KU= 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=SATLEXMB03.amd.com; pr=C From: Ayan Kumar Halder To: , , , , , , CC: Subject: [PATCH v3 3/4] xen: arm: Move the functions of domain_page to MMU specific Date: Tue, 13 Aug 2024 18:13:55 +0100 Message-ID: <20240813171356.46760-4-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com> References: <20240813171356.46760-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD8:EE_|IA1PR12MB6162:EE_ X-MS-Office365-Filtering-Correlation-Id: d887ab63-09d0-49a0-b601-08dcbbbb69ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fWQ8ovHk+DDNxOWEUV6oCXVGSEaDnYfiQnsTEdnJmaTBZ4lriwbz9eLzYzdl?= =?us-ascii?Q?TPKHrt1QpiDPlBbqw6KRih2Fk6LU7A182Jt64uH8306v4ATVcFg3mM5Uu1K2?= =?us-ascii?Q?wK63mYLuo9zOTA5R8wP0k0EQLOnMmHdyAK4h+TktFnwKOUTw/lr7kIl2Umhe?= =?us-ascii?Q?MFY/E+isr2+12sRvkWAzwl9D7jkONNEmLBvfIHx4kZlmQqiegeWGrXn6xkGr?= =?us-ascii?Q?cNFbBot/jLg4f+j6E9k+WLA5y69P2SY47tTSE+av9228tQUv6z+VBDpbhgSA?= =?us-ascii?Q?atHaFtM06vbtE+/eTTi11QnVeSV4A9ORnV88FjiRxJiZfWMVf+40wFC5TzCQ?= =?us-ascii?Q?CkLznhwE1RkLlc5BdIptNIZCaKEtYDUgRgSYTBuInfrF1krenIPTIwVEGRvE?= =?us-ascii?Q?mGHbkqIUFZGbBENCNMxNd4GPpU6t3ACjKcVzP2WKXyfGzxg8J5RWlC7pLQEy?= =?us-ascii?Q?4Ye0pLdF83xxMPlwHXlMaGEka2lzNM7k7yFJZ+LtINK6khl4hnfwDD8fqxyb?= =?us-ascii?Q?5XssYZJAD27yINgRyL/m5seCcaj1C39J5zPJNZV+KCIC5lXhnfcUZ49ITCge?= =?us-ascii?Q?1VX9+acmpqUZXFlN/ljWcSJBHHFFqqGzr5rRKbZcLREolm/+XOfADlKvoOdP?= =?us-ascii?Q?o/SYJj//l6XwuEJnyfcrUD4uHKe1axgR/DPh/BdnSEJ4/u0r1b4A715waKHR?= =?us-ascii?Q?Qx24Y9kwdJGQSBrjE+aehJJlt7VSXCsWzvInOx82ZlODyQsLRN8kK/PV9vg4?= =?us-ascii?Q?ZEvMBGjlQwSrXAkAJ+SOXa8fLzD37BxreU15SUKm1R85o7KqPJ8aIq7Ph4Nk?= =?us-ascii?Q?BAO9Wk9HN56tHrvFM+doZmoDkXHGqOR04Wj3qkkV9VMnjuQ/pfYajhVghZE3?= =?us-ascii?Q?M6XgFHxEEe/mz5zcNIb+pQKKQgrAeN6AKMueNjw0Tlk/q7thA7vXv3jdKcat?= =?us-ascii?Q?5TuhVNifhFknjE6YR85d0kl/4CH1H0o0J/PeCsFH4TglCRdNVLIuWzKzU+mQ?= =?us-ascii?Q?zXbcftufrZYsau/VsmLEbICfyTvvOrzEtabF/cvwhPd5Wj8ajBNPXUJ/KPNs?= =?us-ascii?Q?7CZEhMVMj1pxoN0Hey8SBWrutzhQzqJ8X8r60WmPRjZe96im1JYim1wlKnpR?= =?us-ascii?Q?orLFw0i0fe3Jvll4/4kUjbYVJ5e4pegUvtPY85o/SBmAlymVwP3fT6HwcvOq?= =?us-ascii?Q?bzMIqPWIFfu8KMiSQrgj7CNsDJ3n+jUMxAl5kODqJs2iloM4v9rErRdxCdKx?= =?us-ascii?Q?AkY79gqKG72In/iP7BaOB7QNkLJX7V0Yq4rlSKA8Psu+zWMFsSuKy2zALC4z?= =?us-ascii?Q?HLB5nAzUXcoB/QDdt1KnceJ/L/0iBSsAXScJnb4ngQWDFouNy9KYVoaxitrx?= =?us-ascii?Q?HPISerzqC02r1FM+5xPXOPGjL/y9xcfFhY+XCvJP9TqtRyA+yXlTFXX/M8iZ?= =?us-ascii?Q?WHGNye5Tgb+D12AE82hR5/Da0krSaZDd?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:38.7313 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d887ab63-09d0-49a0-b601-08dcbbbb69ca 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD8.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6162 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723569296910116600 Content-Type: text/plain; charset="utf-8" Moved init_domheap_mappings(), map_domain_page_global(), unmap_domain_page_global(), map_domain_page(), unmap_domain_page(), domain_page_map_to_mfn() to MMU specific folder. Signed-off-by: Ayan Kumar Halder Reviewed-by: Michal Orzel --- Changes from :- v1 - Moved domain_page.c to mmu/domain_page.c. v2 - Updated arm/Makefile. xen/arch/arm/Makefile | 1 - xen/arch/arm/mmu/Makefile | 1 + xen/arch/arm/{ =3D> mmu}/domain_page.c | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename xen/arch/arm/{ =3D> mmu}/domain_page.c (100%) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index da9c979dc4..7792bff597 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -18,7 +18,6 @@ obj-$(CONFIG_IOREQ_SERVER) +=3D dm.o obj-$(CONFIG_DOM0LESS_BOOT) +=3D dom0less-build.init.o obj-y +=3D domain.o obj-y +=3D domain_build.init.o -obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) +=3D domain_page.o obj-y +=3D domctl.o obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o obj-y +=3D efi/ diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile index 67475fcd80..2cb44b857d 100644 --- a/xen/arch/arm/mmu/Makefile +++ b/xen/arch/arm/mmu/Makefile @@ -2,3 +2,4 @@ obj-y +=3D p2m.o obj-y +=3D pt.o obj-y +=3D setup.o obj-y +=3D smpboot.o +obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) +=3D domain_page.o diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/mmu/domain_page.c similarity index 100% rename from xen/arch/arm/domain_page.c rename to xen/arch/arm/mmu/domain_page.c --=20 2.25.1 From nobody Thu Nov 21 19:58:06 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=1723569304; cv=pass; d=zohomail.com; s=zohoarc; b=Qnkr2etT2L8mv6XoyfoYOqbn5OHmxz/MFVKga3TV1zhDD/IprFrt/9pE4bxDT4G0GBb5KP4itmlkPBqo5MQ+tZ/eN9APtjB6k06w77dDsqrfrnZ2UWlYfaWU+8Z64YVwxMb3vkPMcqRAjhpz6gqhtfL9/F2/dWPPvd/1Awnhg4s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723569304; 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=y8syEudjqafW5Qhsj5GpdRFapDEC7fYWqSfZZMYCnLc=; b=ZuxAx2ZYgNPA8Js6Ct4xBtuhokDgazD6QgsMq6SR6b7nO0s+2/VzUNmT2/qD3AFSTyqn8+iEc1E2POQO4hT3XaFBJemod3+12bfJ6hCm0qp5aswgEQYSj2siwoPzjcVAMOP+EtwUsvtWFS9wb2yDZ/ZMk0GJQ7T/atD84wBVvKo= 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 1723569304813715.6720278276667; Tue, 13 Aug 2024 10:15:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.776505.1186678 (Exim 4.92) (envelope-from ) id 1sdv6e-0000cs-FJ; Tue, 13 Aug 2024 17:14:48 +0000 Received: by outflank-mailman (output) from mailman id 776505.1186678; Tue, 13 Aug 2024 17:14:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6e-0000cj-BF; Tue, 13 Aug 2024 17:14:48 +0000 Received: by outflank-mailman (input) for mailman id 776505; Tue, 13 Aug 2024 17:14:47 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sdv6d-0007JM-Q5 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:47 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20608.outbound.protection.outlook.com [2a01:111:f403:2009::608]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 89ff0956-5997-11ef-a505-bb4a2ccca743; Tue, 13 Aug 2024 19:14:47 +0200 (CEST) Received: from MN2PR02CA0005.namprd02.prod.outlook.com (2603:10b6:208:fc::18) by LV2PR12MB5824.namprd12.prod.outlook.com (2603:10b6:408:176::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23; Tue, 13 Aug 2024 17:14:41 +0000 Received: from MN1PEPF0000ECD7.namprd02.prod.outlook.com (2603:10b6:208:fc:cafe::e0) by MN2PR02CA0005.outlook.office365.com (2603:10b6:208:fc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 17:14:41 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by MN1PEPF0000ECD7.mail.protection.outlook.com (10.167.242.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:41 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:14:41 -0500 Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 13 Aug 2024 12:14:40 -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: 89ff0956-5997-11ef-a505-bb4a2ccca743 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mdVWLAXevRfVGlGb8wEf5fDNL1SL4AId9PAuSe+xj9UGHsJOXWj0Qeq79cTAAOmeFANEr471CywhQWFw3mfH3Ilvj7UGDQcU43lV/aVnptlD/IoVkymJPMWUCap8922fo0+lecKX4GpPLu7n7JTIXnZ51DSa7xWb3DNY+bWN2DFd3jdMuHY7G0BytdnB2N+QSt8EobzGJc7aYUnCqHmNZq7qXmJRiMfwSxM8mEd3QC/i+Ncp4P/F5Ov7Us6Q4cwqlKi9+ZDJS/eeEojJO0eanbvd2fp00TEeYMvLOx6Bk7LTsh8onJDFHE5Mr7adMqz+0Qkv74fB4pgL3sT9RcIGfg== 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=y8syEudjqafW5Qhsj5GpdRFapDEC7fYWqSfZZMYCnLc=; b=AjbMOxaVsGdqEY3gMUX+ZZzZn3c76+m3JGz8j5/eIUq7Rg+C7D2cMqN4Y/VuGea+aZ5SBSWxsnHnyeXTqf4agviHwgS3ozAOH2unwW6XDDpZ44YCHYKw80zxliM3H0ovHWgx6pY2fuki/x6JmT4rzB6Big+JD9eNor8bExeWAvPtnuO0SJh6hpVr31kNMstR4cPs2P+YGEcc+1+7Y9D4SapFE5ORw+904ahKdWILiAIVaEb8V7eULaOtsVR+/l+UJV/Y1h6WMXMHpenDc+VF9o8oNDp8CtHV8qcqjihClK+/Og2MO5ioI+7Gz05Adp9GYmtHWYvzFlMyVxVby+Dphw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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=y8syEudjqafW5Qhsj5GpdRFapDEC7fYWqSfZZMYCnLc=; b=WYKr+BVcPAeHrkEDj8a4SjXu/DE3ILT+Y1/gEuYL3jpa8gehr5JIP36xmPBtqBbDcdAnWWvAD2DB5z9u42fse6fRQJv+gXv0VifGG8xLjy6s9o5aB3BecKGj/ygKnhJO0dPYMWi2nURzaDg6fTopb3xh6Lr3N/aoxVcpakIZyZ4= 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=SATLEXMB03.amd.com; pr=C From: Ayan Kumar Halder To: , , , , , , CC: Subject: [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU Date: Tue, 13 Aug 2024 18:13:56 +0100 Message-ID: <20240813171356.46760-5-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com> References: <20240813171356.46760-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD7:EE_|LV2PR12MB5824:EE_ X-MS-Office365-Filtering-Correlation-Id: d9072e21-ecc6-4c95-a3a9-08dcbbbb6ba2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?JervzM7SJYMxSror9GyoOpUDbtkJjSrwghk2bLnl/B7HHrsPkvAkas+217gF?= =?us-ascii?Q?ngQU06ZdNs0fhKIDMD72wf3697z0++3UiNIdciW8/Oap0H11tmizyqiU3JxR?= =?us-ascii?Q?9BxxsqIJ1rjsDubw4l6Qa2OSfTG9ehq5Z3FxK27pFTI7iD5A2I+tvjYQC7+l?= =?us-ascii?Q?CnKUbog0hlqMhpDWT/ThC3lay4j6nCX8uE94aQKZAOBr02sBqNiW9xGpAalj?= =?us-ascii?Q?C5aejsecMtVfALKUbV1lP0wynn3GOM7mH039NUTPfinx5iFiz37vGAC7eoIh?= =?us-ascii?Q?UR97EvFhzUCRt1nxV5xcGX122nAPcKS/KdZN9VCUD++g14NHEFnJRw3OHRks?= =?us-ascii?Q?V97u34R+Z7KjzR6fMt/ciLO8vkghbtwF36kNd8bJs7pNPvmKxbRgTTbU9DxL?= =?us-ascii?Q?oXuBOj6Po9BGaj0MUjB31H6h5/iyWJZEwcrGXSgvo7jZ+Tgbc/n/XBHxkJET?= =?us-ascii?Q?VT72Pz8uaeBZJsjhT4DvBSDZ24c2uW40kfSYGmXwni4ud7Bl7DgAuorjryZg?= =?us-ascii?Q?2W9YsFnwT/7by/OTfHZwJn/QXPbrLtVQLVd4kbSKtNzxk3HMH7Y4N9MFc0C4?= =?us-ascii?Q?I7Lzj0VAMeYtFAxu/ndwJMRabLRKlvtq4Bvd3JTC26osqW+nYyAa84/AFMKp?= =?us-ascii?Q?unpRXRt5lTytrF9ArCFIX9qJZmFIC37y+JstA0JYbKk1Dm+j9doOeauafi5i?= =?us-ascii?Q?5CI2gVAEEs8wyGi4CiygvzrFStmjAGf8QM7fxWj55EpLRY6gGFTP8x84ry9l?= =?us-ascii?Q?cfVvaSHmtvFzqfD120sL/psRgE/hINgHgFkBnjvgfqjzoR4in3QhPHP2NyI9?= =?us-ascii?Q?JAgNadlY1dIXftFPZDM9cbRgFJ+bqm5IuFRAeBIKXn07VR8GXIN8BjAEwsws?= =?us-ascii?Q?grsoUs6u2gT4+tEgGk5T7RtOqNnZpYjCG8XfDFnD98bOGnPZbHdHYKa2DQad?= =?us-ascii?Q?A2v0/F8UIiulDga4p8V6ifwBpkzUnqv3vsA13AB31CorD8qXBemqj97eUgil?= =?us-ascii?Q?F4KSmLUyr01obPSUlo5PYPHxnpSkPD7yihbKTUO5DKInvUedhtqOw9HY2QEv?= =?us-ascii?Q?P41K8Dgn6whtf7+jgrAzXNjxe5Cu2oFwmPW2isb0js42/bhFSjZGGmzk2HnU?= =?us-ascii?Q?JnsvOCtoNjgF1Js8Q1oP2vJqBmzZaUJRdjRTUbLPSY/TsmrRhqgB5dyT/zvK?= =?us-ascii?Q?6TkMCjR9gf/kjNajpdMY5u675sOCLT9w7NoSZxGFYvoJ4flW567s7XdVCRpq?= =?us-ascii?Q?ry/0petoxFKatbuZKVgaucSCQRxTMLuiKM8c9h6TRkEu2mz3MrMkTMBlquQY?= =?us-ascii?Q?Trm3UKO4WnZAX3B2qRdMbkGdpbujZITSkCiIXCLCdk/qJehr5nyPxzGgJDmz?= =?us-ascii?Q?QH5KiPb9QAQHkOOlRzdRpZQcGMsS/r/fN7hVrJrqSgxOy2qevnpleEicNhBD?= =?us-ascii?Q?OdxeZBk7DphCYTj+mT2G2ITrqomTdRWz?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:41.8085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9072e21-ecc6-4c95-a3a9-08dcbbbb6ba2 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MN1PEPF0000ECD7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5824 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1723569306945116600 Content-Type: text/plain; charset="utf-8" All the EL2 MMU specific registers are enclosed within CONFIG_MMU. Signed-off-by: Ayan Kumar Halder Reviewed-by: Michal Orzel --- Changes from : v1 - 1. 'vttbr_el2' field is enclosed with ifdef. 2. No movement of code. v2 - 1. Enclosed 'vttbr_el2' access in show_registers() and vcpu_show_registers(= ). xen/arch/arm/traps.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index aac6c599f8..737f4d65e3 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -720,8 +720,10 @@ struct reg_ctxt { uint32_t ifsr32_el2; #endif =20 +#ifdef CONFIG_MMU /* Hypervisor-side state */ uint64_t vttbr_el2; +#endif }; =20 static const char *mode_string(register_t cpsr) @@ -919,12 +921,16 @@ static void _show_registers(const struct cpu_user_reg= s *regs, #endif } printk(" VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2)); +#ifdef CONFIG_MMU printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2); +#endif printk("\n"); =20 printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2)); printk(" HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2)); +#ifdef CONFIG_MMU printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2)); +#endif printk("\n"); printk(" ESR_EL2: %"PRIregister"\n", regs->hsr); printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2)); @@ -956,7 +962,9 @@ void show_registers(const struct cpu_user_regs *regs) if ( guest_mode(regs) && is_32bit_domain(current->domain) ) ctxt.ifsr32_el2 =3D READ_SYSREG(IFSR32_EL2); #endif +#ifdef CONFIG_MMU ctxt.vttbr_el2 =3D READ_SYSREG64(VTTBR_EL2); +#endif =20 _show_registers(regs, &ctxt, guest_mode(regs), current); } @@ -979,7 +987,9 @@ void vcpu_show_registers(const struct vcpu *v) ctxt.ifsr32_el2 =3D v->arch.ifsr; #endif =20 +#ifdef CONFIG_MMU ctxt.vttbr_el2 =3D v->domain->arch.p2m.vttbr; +#endif =20 _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v); } --=20 2.25.1