From nobody Fri Dec 27 00:25:59 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=1732732784; cv=pass; d=zohomail.com; s=zohoarc; b=j4VJoSRhuZuNtzBI8d27z19jMOhZGTc4ZGrnu6vqftoh/PboDdI2JQWRv0KHMOQmZ4rbpLVDBgSoNe1YY08OTugQ+sJhccRQrnFUOyRYAZ4jzjZWYJMchDOQXGd4PjMpiJ880BG5D3kGGUeuPRDsYjSvD6kJ2skp3ebmlcNJk/0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732732784; 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=4y0rqKXx3iOgUdFHLMYjo9xQCZSV35vv3Q1T2p0SOFI=; b=Cr94YkC4RFCjenPAo/a0h4PxD1zL7+NPal6xexBfz2tsZRQLGhTC4zF2x9Y39ctYwqMBfJ+oUE60iOEFFOlD/9HEf2JDYEjAJUk30Y5kAgCKD2HTQu0KXTYAMkRU2NiYijVygEtq317MEl7LfiYQEIk0HUw32crRL9qVg9/6eKA= 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 1732732784680352.4447209548888; Wed, 27 Nov 2024 10:39:44 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.845061.1260564 (Exim 4.92) (envelope-from ) id 1tGMwk-0003np-Bn; Wed, 27 Nov 2024 18:39:30 +0000 Received: by outflank-mailman (output) from mailman id 845061.1260564; Wed, 27 Nov 2024 18:39:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tGMwk-0003nR-49; Wed, 27 Nov 2024 18:39:30 +0000 Received: by outflank-mailman (input) for mailman id 845061; Wed, 27 Nov 2024 18:39:28 +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 1tGMwi-0003ey-AY for xen-devel@lists.xenproject.org; Wed, 27 Nov 2024 18:39:28 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20616.outbound.protection.outlook.com [2a01:111:f403:2418::616]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id eb26a7ee-acee-11ef-99a3-01e77a169b0f; Wed, 27 Nov 2024 19:39:23 +0100 (CET) Received: from MW4PR04CA0358.namprd04.prod.outlook.com (2603:10b6:303:8a::33) by SN7PR12MB8601.namprd12.prod.outlook.com (2603:10b6:806:26e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.20; Wed, 27 Nov 2024 18:39:17 +0000 Received: from CO1PEPF000075F3.namprd03.prod.outlook.com (2603:10b6:303:8a:cafe::ec) by MW4PR04CA0358.outlook.office365.com (2603:10b6:303:8a::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.12 via Frontend Transport; Wed, 27 Nov 2024 18:39:17 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000075F3.mail.protection.outlook.com (10.167.249.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8207.12 via Frontend Transport; Wed, 27 Nov 2024 18:39:16 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Wed, 27 Nov 2024 12:39:15 -0600 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; Wed, 27 Nov 2024 12:39:14 -0600 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: eb26a7ee-acee-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjQxODo6NjE2IiwiaGVsbyI6Ik5BTTEyLUJOOC1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImViMjZhN2VlLWFjZWUtMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMyNzMyNzYzLjAyMDAxNywic2VuZGVyIjoiYXlhbi5rdW1hci5oYWxkZXJAYW1kLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j2RbwfX6xTpf5R/kORNeu+o6nLlj4GEySUirxPFdtf2BM52Meyb3crdvkD6YQOGMAmv9c+OY78Xf2S350Zn8IgsUEY9Gtr0CjBWrHNFK8zgz9Rkt/udxM67wcjOJaoSXA+4mY6EszQSYUQvsbH0ho+ISUa4iz91vONAs2ylMNA2a9AX3I6wzbGmFYYmb0gt466JU6Emu2X+VjpF0iEuQUS9kM4xhg+k/nCyo0pNyDFN3trnU3F0HAbQt5dqlfACoC+kU0TXKhr88BKrHIMLXzkX7Kn6gjKKwphJhJf6JXM0OTUd3Yk4o5n4yUelf8t+r5vt6o8JW6ObC0CuYoC4HRw== 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=4y0rqKXx3iOgUdFHLMYjo9xQCZSV35vv3Q1T2p0SOFI=; b=vkE3hW1Ea7kmwUb3kUqNeEimOiiyvYSZMVv4SnQgCD6UQGRYeOERcwgPI0ncufAW3OCq2e/lmxgaQLhwJagfNfdV85bi4xodyDtCqAo1JfcYxPIioIv1gGSsxpq8iA5FtimrywUFzGw4Ryf5kxQRo9OQQRKVPHfbDJqaBuy+O8NLkBKJnjFvkD7Zf4PyIFR/3O10oTMZ1Ft4KVmeoJHtLBFcwnPF+qveznmDf3NDDRJK8K00C8QQ/Nr8ojT0zfTvFZ3SNdfndGbOHUfiRWdWTa+YhsvCa797Jtm5tp5yFjpy1SpNCpGXarHPsoLM5iQBzgQ8WW4Pq76eIJyZQObcXw== 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=4y0rqKXx3iOgUdFHLMYjo9xQCZSV35vv3Q1T2p0SOFI=; b=Zq8EUiQ8jIxCEyUyN6z4qgylFYriFZ6wKcb6pWEFsfGdby324EnwAJYDfjXp79bE6D7SyuD7zrK+pIS7nlRXLcjbDkbzBdaAfn+bl+3HZf7OLF4lQJuxsUIMd6jHhJY8OXLfTTCRD8drF0dgBfNS9iZrWZNSiGL8KWDc1H2gfBQ= 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: Ayan Kumar Halder , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" Subject: [PATCH v2 1/2] xen/mpu: Map early uart when earlyprintk on Date: Wed, 27 Nov 2024 18:39:05 +0000 Message-ID: <20241127183906.485824-2-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241127183906.485824-1-ayan.kumar.halder@amd.com> References: <20241127183906.485824-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: CO1PEPF000075F3:EE_|SN7PR12MB8601:EE_ X-MS-Office365-Filtering-Correlation-Id: ac3b41ab-d065-4906-1b9d-08dd0f12cc17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jx0rjZZVodD4/tJ1I6ZRurYos7O3lwBx8RufauL/h2r9nImnRoxkzl3W8jiG?= =?us-ascii?Q?LoDeSBcxcmlL3dSBU1jr2uoTJZ699wRqLZxpFi69spZuuRXlOLvO7Uaou7Yt?= =?us-ascii?Q?Zx4DNDVhCIMR1/uuLsQQecq59d4EYazsgDCRoNR+Ht9c5lTL1GytXuWwmBlz?= =?us-ascii?Q?4rOR4qrDYe4j981g5xmfd8MiYQIVciK+pWA7nVMiR2eyawbh2EPkZgx+wJ2K?= =?us-ascii?Q?QMuReypAGVvDXfPL431dsBbs44yK5pK5b0OxPpvehH+L/ChVgCipkFFAQMMw?= =?us-ascii?Q?DnB1P3r2bVrPNTM7M6x0VC7f+wQ7HIrpaaxV5EauXAxY6RT80SeQOJ1zh084?= =?us-ascii?Q?Bn4G/sH0fS2+sOOCweTC1rjtwlAuDl837j6dUED2ioS3WRsvWzvs6zKkUlax?= =?us-ascii?Q?vrUFWZmAE6FVooDh5QJUJ2DioVLIAnA6Cqej0To87MYryoVkJWXwuopQdkHL?= =?us-ascii?Q?wo7sRmS+RmOJ7MqLXH2xQrIdoh09g3o/tGcUCzWE58NXkrPZDuIIaxw7f2zL?= =?us-ascii?Q?nY8AqG6MrU6fgnv0rvGL7qGrkBGNrSe8j7NgEmRKKkqzjIXWkiGAhAuvYIiS?= =?us-ascii?Q?x9E2fhfOL2VycxwFXjfQE9aZWX/InullpM2Lg2DI4OYXX7hFahLpBKnBGrq3?= =?us-ascii?Q?u3nDGsxZWK3Vkb842hlxFdk5T/+H/LCr9WFThn21ikvF01vAYGKqI6w0Co8k?= =?us-ascii?Q?UoQIQmmZTjvJeY812SBkYGd8eJrV7HQADatFhZEcKM3y+zW1xDDKUgRRg1MI?= =?us-ascii?Q?PPlonsvb/Z28qOJoyztR5L8Zk73F2WJmjLYcKpX+8jp7olKLnCRzbgj4LMoI?= =?us-ascii?Q?mAhhvUGaAsxdHIFpuXZYnWn0mRnrYAFrIEQrlMqdMfHxnNSBVkWfeZ7G6aqE?= =?us-ascii?Q?lTK46xMJzs7sMgjeVXFs6Y0hHAtbL/2dx3GUzjA9jMKpuDPjH3xnMzxBROGp?= =?us-ascii?Q?dt46yw0DQyJcepc0WGJ2N6i6g3be4UCiHev3taKVDEWQZQq5AXviUXOJW1YN?= =?us-ascii?Q?Xz7/QYGb1QxZWUvXpmEQI/aUInMSI4n8Qg0VnTRE10vANmyTuqBMvxY8Frqg?= =?us-ascii?Q?ORwOgiPANy3es+DMLLiMo0DKcaB1w4wRO8OzPxpzmX7WjLXrnmm0BrtehOF6?= =?us-ascii?Q?4nQdKqAJan/5Sqi1+SAkReU+RqsuDhXIVJY0YBWRbJPkGNebWo+IXt82NdcT?= =?us-ascii?Q?38TqZaJmgzJRPk9wk4rN1MO1dY9S0WWNOqrdlY4EScQFBIprEQJ8/6BQDnbb?= =?us-ascii?Q?1aFgOfgJWSPy4QQUgAZGveATwE+/++6F3i2axj6dH+ISCJgzEemmPTOItM3Y?= =?us-ascii?Q?7xaT351PzKRN2t8BHJLOJnQ8TPIhXR/5XJHX+WOCTYVmqfPLgINaX6rhOJOK?= =?us-ascii?Q?z0ePd4eM7X5lpa6LItupkK6ogPMF+ZN7NOg65CAQULRbuO1zjfT8NRaRLhS5?= =?us-ascii?Q?y6KtOYzYP4g2Y/yIiB7Kums3x/TLqZyz?= 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)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2024 18:39:16.2654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac3b41ab-d065-4906-1b9d-08dd0f12cc17 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: CO1PEPF000075F3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8601 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1732732785243019100 Content-Type: text/plain; charset="utf-8" CONFIG_EARLY_UART_SIZE is introduced to let user provide physical size of early UART. Unlike MMU where we map a page in the virtual address space, here we need to know the exact physical size to be mapped. As VA =3D=3D PA in case of MPU, the memory layout follows exactly the hardw= are configuration. As a consequence, we set EARLY_UART_VIRTUAL_ADDRESS as phys= ical address. EARLY_UART_BASE_ADDRESS and EARLY_UART_SIZE should be aligned to the minimum size of MPU region (ie 64 bits) as per the hardware restrictions. Refer ARM DDI 0600A.d ID120821 A1.3 "A minimum protection region size of 64 bytes.". UART is mapped as nGnRE region (as specified by ATTR=3D100 , refer G1.3.13, MAIR_EL2, "---0100 Device memory nGnRE") and Doc ID - 102670_0101_02_en Table 4-3, Armv8 architecture memory types (nGnRE - Corresponds to Device in Armv7 architecture). Also, it is mapped as outer shareable, RW at EL2 only and execution of instructions from the region is not permitted. Signed-off-by: Ayan Kumar Halder Reviewed-by: Luca Fancellu > --- Changes from :- v1 - 1. UART base address and size should be aligned to the minimum size of= MPU region (and not PAGE_SIZE). xen/arch/arm/Kconfig.debug | 7 +++++++ xen/arch/arm/arm64/mpu/head.S | 9 ++++++++ xen/arch/arm/include/asm/early_printk.h | 28 ++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug index 7660e599c0..84a0616102 100644 --- a/xen/arch/arm/Kconfig.debug +++ b/xen/arch/arm/Kconfig.debug @@ -121,6 +121,13 @@ config EARLY_UART_BASE_ADDRESS hex "Early printk, physical base address of debug UART" range 0x0 0xffffffff if ARM_32 =20 +config EARLY_UART_SIZE + depends on EARLY_PRINTK + depends on MPU + hex "Early printk, physical size of debug UART" + range 0x0 0xffffffff if ARM_32 + default 0x1000 + config EARLY_UART_PL011_BAUD_RATE depends on EARLY_UART_PL011 int "Early printk UART baud rate for pl011" diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S index f692fc7443..86e4019a0c 100644 --- a/xen/arch/arm/arm64/mpu/head.S +++ b/xen/arch/arm/arm64/mpu/head.S @@ -11,8 +11,10 @@ #define REGION_TEXT_PRBAR 0x38 /* SH=3D11 AP=3D10 XN=3D00 */ #define REGION_RO_PRBAR 0x3A /* SH=3D11 AP=3D10 XN=3D10 */ #define REGION_DATA_PRBAR 0x32 /* SH=3D11 AP=3D00 XN=3D10 */ +#define REGION_DEVICE_PRBAR 0x22 /* SH=3D10 AP=3D00 XN=3D10 */ =20 #define REGION_NORMAL_PRLAR 0x0f /* NS=3D0 ATTR=3D111 EN=3D1 */ +#define REGION_DEVICE_PRLAR 0x09 /* NS=3D0 ATTR=3D100 EN=3D1 */ =20 /* * Macro to prepare and set a EL2 MPU memory region. @@ -138,6 +140,13 @@ FUNC(enable_boot_cpu_mm) ldr x2, =3D__bss_end prepare_xen_region x0, x1, x2, x3, x4, x5 =20 +#ifdef CONFIG_EARLY_PRINTK + /* Xen early UART section. */ + ldr x1, =3DCONFIG_EARLY_UART_BASE_ADDRESS + ldr x2, =3D(CONFIG_EARLY_UART_BASE_ADDRESS + CONFIG_EARLY_UART_SIZE) + prepare_xen_region x0, x1, x2, x3, x4, x5, attr_prbar=3DREGION_DEVICE_= PRBAR, attr_prlar=3DREGION_DEVICE_PRLAR +#endif + b enable_mpu ret END(enable_boot_cpu_mm) diff --git a/xen/arch/arm/include/asm/early_printk.h b/xen/arch/arm/include= /asm/early_printk.h index 46a5e562dd..606aaedd6e 100644 --- a/xen/arch/arm/include/asm/early_printk.h +++ b/xen/arch/arm/include/asm/early_printk.h @@ -15,6 +15,29 @@ =20 #ifdef CONFIG_EARLY_PRINTK =20 +#if defined(CONFIG_MPU) + +/* + * For MPU systems, there is no VMSA support in EL2, so we use VA =3D=3D PA + * for EARLY_UART_VIRTUAL_ADDRESS. + */ +#define EARLY_UART_VIRTUAL_ADDRESS CONFIG_EARLY_UART_BASE_ADDRESS + +/* + * User-defined EARLY_UART_BASE_ADDRESS and EARLY_UART_SIZE must be aligne= d to + * minimum size of MPU region. + */ + +#if (EARLY_UART_BASE_ADDRESS % MPU_REGION_ALIGN) !=3D 0 +#error "EARLY_UART_BASE_ADDRESS must be aligned to minimum MPU region size" +#endif + +#if (EARLY_UART_SIZE % MPU_REGION_ALIGN) !=3D 0 +#error "EARLY_UART_SIZE must be aligned to minimum MPU region size" +#endif + +#elif defined(CONFIG_MMU) + /* need to add the uart address offset in page to the fixmap address */ #define EARLY_UART_VIRTUAL_ADDRESS \ (FIXMAP_ADDR(FIX_CONSOLE) + (CONFIG_EARLY_UART_BASE_ADDRESS & ~PAGE_MA= SK)) @@ -22,6 +45,9 @@ #define TEMPORARY_EARLY_UART_VIRTUAL_ADDRESS \ (TEMPORARY_FIXMAP_ADDR(FIX_CONSOLE) + (CONFIG_EARLY_UART_BASE_ADDRESS = & ~PAGE_MASK)) =20 -#endif /* !CONFIG_EARLY_PRINTK */ +#else +#error "Unknown Memory management system" +#endif =20 +#endif /* !CONFIG_EARLY_PRINTK */ #endif --=20 2.25.1 From nobody Fri Dec 27 00:25:59 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=1732732787; cv=pass; d=zohomail.com; s=zohoarc; b=eN5cyzOBKZsQ5wQ0qYIh8BSaXQzJHGd6PswXiQFCJNOU3q0xPYQWB8JguMbOxsiXwl/rLuu+FaK7PxYj2jZcp7dfbKy6hY5JiycwJp65nn3q7OMMFU0aj1WMzLyuvEE3oOGDHrlb8gyFWjZj3xRZlEnq9AAIElJrCOKEmPaG2z8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732732787; 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=8jtdmgz0hp1h/Jnfpbux2OZYxEMLnlqEMOohpnY6AL4=; b=bYFKYUeDCwlLv8HqyvRRAycuNafWGFy5IwxHaNWL2wcow2A8Eeq1Co0V7RP8xWkpe6PhbvDhS2pbemj24vGkZ+dVGGQIyfM/R7Fd0rQwJTR6kfeq+Gfm3xVv+NpsUmNSxmiOXfRY1ybWIGv7QrEukq0M5RtEkBP0RriQC/JtflI= 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 1732732787620151.4911599358163; Wed, 27 Nov 2024 10:39:47 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.845060.1260557 (Exim 4.92) (envelope-from ) id 1tGMwk-0003hF-0p; Wed, 27 Nov 2024 18:39:30 +0000 Received: by outflank-mailman (output) from mailman id 845060.1260557; Wed, 27 Nov 2024 18:39:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tGMwj-0003gl-TA; Wed, 27 Nov 2024 18:39:29 +0000 Received: by outflank-mailman (input) for mailman id 845060; Wed, 27 Nov 2024 18:39:28 +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 1tGMwi-0003ez-7t for xen-devel@lists.xenproject.org; Wed, 27 Nov 2024 18:39:28 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20609.outbound.protection.outlook.com [2a01:111:f403:2413::609]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ebcdb97f-acee-11ef-a0cd-8be0dac302b0; Wed, 27 Nov 2024 19:39:24 +0100 (CET) Received: from MW4PR04CA0356.namprd04.prod.outlook.com (2603:10b6:303:8a::31) by SJ0PR12MB8115.namprd12.prod.outlook.com (2603:10b6:a03:4e3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Wed, 27 Nov 2024 18:39:19 +0000 Received: from CO1PEPF000075F3.namprd03.prod.outlook.com (2603:10b6:303:8a:cafe::b) by MW4PR04CA0356.outlook.office365.com (2603:10b6:303:8a::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.12 via Frontend Transport; Wed, 27 Nov 2024 18:39:19 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CO1PEPF000075F3.mail.protection.outlook.com (10.167.249.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8207.12 via Frontend Transport; Wed, 27 Nov 2024 18:39:18 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Wed, 27 Nov 2024 12:39:18 -0600 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; Wed, 27 Nov 2024 12:39:17 -0600 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: ebcdb97f-acee-11ef-a0cd-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDE6MTExOmY0MDM6MjQxMzo6NjA5IiwiaGVsbyI6Ik5BTTEwLURNNi1vYmUub3V0Ym91bmQucHJvdGVjdGlvbi5vdXRsb29rLmNvbSJ9 X-Custom-Transaction: eyJpZCI6ImViY2RiOTdmLWFjZWUtMTFlZi1hMGNkLThiZTBkYWMzMDJiMCIsInRzIjoxNzMyNzMyNzY0LjMwNjYxMSwic2VuZGVyIjoiYXlhbi5rdW1hci5oYWxkZXJAYW1kLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fLe0If6WsONRtyEHmf5zDPeStyUrMubEhaPDMpvlxL9H5mR5LgoDCGJqxqbonIbFLwfCwsZk4durN71SU/k/lt/mlTSie0GTZF9yMqWafUq5U9GQSoICyOT0HScQI2fGZD/xDwOL7ecNi0hrNHJ3xJieQRJhh/JhrEa3egiYWSgzhCKaYU6A96f0RzLIm0NCJ7dFbxQTxpN42jjzruyPQ6/H32OqREDS19DxaGLvUcn0FXIChFL/Azx3dKfcvsJYcytwl4ols9mC+aF3L53237hru7ILABV5OxtBC6Tp+A1BXU5ylIjappGV/nFNN3UMeVHkHgdremtPTfS4rCYtjw== 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=8jtdmgz0hp1h/Jnfpbux2OZYxEMLnlqEMOohpnY6AL4=; b=UJGwk+mrb1H9hkNr92oQTAbNSKQDk2Bud8Pm0HF9xQqIFCLDOgfU4tqRTOElxZ+7FUMEsn5Yx8sDNmFdo4KcWRg4+d/t0VZb4hkR3JjZqda3UXJiU+p4Hiyc2MTu2suGdkpchcKAleH02KzSHWciCAd8VTO5jsDDSnsgr6mtBnnwKP1H7PPTr5rS2SQxmiVV3p0XPs/bOtvQaeE+WslDL9WDSs4KxRWcuemjuZ+0gTaNuMFH4VvgruDaacv5ngQ9yUwu5sJobvipsIqSeRn7xUyZshZUx8f/95LNkuxdHgD+GYHTS17cU9lgxE0AvaZaKIChR4H8V3ImElwmLj0wIQ== 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=8jtdmgz0hp1h/Jnfpbux2OZYxEMLnlqEMOohpnY6AL4=; b=grjmfS3Mye3jyTIFQH7m10w6GZxpRAxE0JuFIiFWi0OQaDiPpwOA6A6PHnmiC1WrpW87IiwgvlDwQq0HwnJLibQGUR5XD0vcm/MtFgAcSkVDchL0Y/W63nN492Vf/2MTSLC7Y2kSMuCOsj4q5XHaQ1J7UXGcq3VA4lwX8mXb43g= 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: Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Ayan Kumar Halder Subject: [PATCH v2 2/2] xen/mmu: enable SMMU subsystem only in MMU Date: Wed, 27 Nov 2024 18:39:06 +0000 Message-ID: <20241127183906.485824-3-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241127183906.485824-1-ayan.kumar.halder@amd.com> References: <20241127183906.485824-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: CO1PEPF000075F3:EE_|SJ0PR12MB8115:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c96b7be-6899-4369-f778-08dd0f12cd96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fjMW/dXVnGdjTj6+wFY4rx4ME8wdk7IyA0QC5NInbW4/YO2ezYwlaY7NFunC?= =?us-ascii?Q?sUGuwtWyufai0OFVWO7qUF502WbTkpRAU9g8/viqk16HfsaAa/BSr4kzHTMV?= =?us-ascii?Q?NlsL9hiRxf/S/pPZ+SJXQhxY031Om71lm3UroFLj8rK55kt+99ZXvlws5j23?= =?us-ascii?Q?cwgu2Yyr0ySCVE+0+TzPAn9kThdxb8Ay8Y3WQJnZwe+rissdrETK1B4MclvM?= =?us-ascii?Q?fXjyK9Z0GqqiYmPbTzxmEOAjVaSARkSwhampqRNuIMCUg/EOMNBESWyb1tGs?= =?us-ascii?Q?gPHx0kZQAKCazrbyEewLOabXHE0rEVhKyOTjxteANGaiZpSZRr8cXsSZZgLZ?= =?us-ascii?Q?3ZeU9NI2LleyF1mT7zSu8KJ1+vZ5dp25tu64cSmxdxWo8w+R5QkuoevMgm64?= =?us-ascii?Q?dQubXIb3IKRYITppJowavG6qztmpd5LaSGN2swlxvXIzam8XhSo1zTGfZwal?= =?us-ascii?Q?T+VPExPk8C4G4zVoNTMXOEN6mpnJqHx9G6jj4vgyR4OHxiUFQZ2LFPNZGCpn?= =?us-ascii?Q?c/EHWv6xP6hIkHLgk3jpDOeCcMATKgBec+HKB9kZrBYq1nJu7UCzfRHzXAFG?= =?us-ascii?Q?US63A6sJE1TezWdiJxa1mrB4QAdAbVYC9b1aszuf0wxw5+rJ0yCbuF3UKjfc?= =?us-ascii?Q?qip9CJZonMCHw26GqzszXktb0D9WC2FOWslFF73u1pIAvtRaAipeVFPP4aUR?= =?us-ascii?Q?c7jAy2epaDbDe6RH/GolDD+qjfndgpxJVDjoqkxhAWuOzuucwt+AaCgvcP3Y?= =?us-ascii?Q?iNaYcmEhSLPodd9LK7lTqifCNUep6xL1RtCxIqGAYasc1n5PGgH2qh+k5WLr?= =?us-ascii?Q?rnS1lCQ6FEEv7WvcaK7zy8nqvFn1iHu323PZE7Ft5hZSzKlToU6B5xskQya9?= =?us-ascii?Q?874DXHpGzUwdfCUlM333cKIqmxm4a3lRgyMvosBGRBMOTNRzCtiz6WcHSSYu?= =?us-ascii?Q?ogwNvj/Hk/WhDVwc/nKz47JK6aKUHpBV5CucX1HPfdlBzQfE6MvGisWYgBEI?= =?us-ascii?Q?NMI1mtDYglj2ma0akve3G6hMTaJnbqDU9YyTdn2AwTayC7QCM2gyM2DRVF+U?= =?us-ascii?Q?rTngZ7rqwuLRD4ytiGeS6VQhujvEchAaB7hrDl5uKH8X57C2fcIzIxvoNmMV?= =?us-ascii?Q?BcPNxwV4lXKnK+lQHD6PWHbv6GpEiKM90wkOIcbSvO8JHiV2a2M9e2cmEif7?= =?us-ascii?Q?7FNOc3tO4P4Xe1FFLDJF2IvB7jNKfxFXiYl98TiOFrk+lPwQa6rolb/eiLSq?= =?us-ascii?Q?n9K+DNLfjiPpa9ESEPVWMozbUhEpe9FKm6kYk3R7mK14/RwpxOXf47MB+RlY?= =?us-ascii?Q?SDXL1ZFt5xrEzQEgqh6jckW5Qat0sFvY/oPosYzV9HT/KdzgDmweQR7ICA/O?= =?us-ascii?Q?AYkJKuHGCOhygnU6fqAeZ7ENGRaQ55vN/SJbhzXlNDAF+ZfazRVxn7LcBp7y?= =?us-ascii?Q?blf3untmMNWVdedPNZYYxw4zIZie3v91?= 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2024 18:39:18.7810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c96b7be-6899-4369-f778-08dd0f12cd96 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: CO1PEPF000075F3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8115 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1732732789349019100 Content-Type: text/plain; charset="utf-8" From: Penny Zheng In Xen, SMMU subsystem is supported for MMU system only. The reason being S= MMU driver uses the same page tables as MMU. Thus, we make it dependent on CONFIG_MMU. Signed-off-by: Penny Zheng Signed-off-by: Ayan Kumar Halder Acked-by: Julien Grall --- Changes from=20 v1 - 1. HAS_PASSTHROUGH is now enclosed within "config MMU". There was a pending response on "[PATCH v1 2/2] xen/mmu: enable SMMU subsystem only in MMU" that it might introduce a bunch of #if-defs in arm specific common code. However, there are alternative implementations possible to reduce #if-defs. So, that can be decided at a later point in time and should not block the current patch. xen/arch/arm/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 15b2e4a227..adebf8d5ca 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -14,9 +14,7 @@ config ARM select FUNCTION_ALIGNMENT_4B select HAS_ALTERNATIVE if HAS_VMAP select HAS_DEVICE_TREE - select HAS_PASSTHROUGH select HAS_UBSAN - select IOMMU_FORCE_PT_SHARE =20 config ARCH_DEFCONFIG string @@ -78,6 +76,8 @@ config MMU bool "MMU" select HAS_PMAP select HAS_VMAP + select HAS_PASSTHROUGH + select IOMMU_FORCE_PT_SHARE help Select it if you plan to run Xen on A-profile Armv7+ =20 --=20 2.25.1