From nobody Fri Dec 27 16:29:30 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=1733333003; cv=pass; d=zohomail.com; s=zohoarc; b=Ey8omc7mVoZScuhyjLPN4wbONroMDamJztoCgdhLmaw8s2vkXZRinIxkqtpp0a3ehZkvZuBxNI0WvQ6yvqrt12IUjr5gBVF55Bso9nODvdUoLg0uYQkSMnow0ebqhNTNobLiSoYe1sYG9WSG8yOLYcruQvRAVohJ++YcPrQjUAc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733333003; 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=eKRJlYZj/vM8lMPFruBRq7uav07apuOnarZh8uy17dk=; b=h4g13lXGE/Gc5NZAJkAsQt0S6junqKExmTdZO7MoqopPklgdXsT+zSv6bBFTePNSps1CuUW0UfCGM9jDyS9wGXNVh0F1F8/Za2F+6RmRV/fDubqcpcF6pR5/E2O7BZ9+yEARVLXOwTmCyhc5K78nwKRZUUMVKvGi+CQnv+KTo/w= 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 1733333003239385.0772162280706; Wed, 4 Dec 2024 09:23:23 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.848683.1263521 (Exim 4.92) (envelope-from ) id 1tIt5Y-0005U9-VZ; Wed, 04 Dec 2024 17:23:00 +0000 Received: by outflank-mailman (output) from mailman id 848683.1263521; Wed, 04 Dec 2024 17:23:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tIt5Y-0005U0-Su; Wed, 04 Dec 2024 17:23:00 +0000 Received: by outflank-mailman (input) for mailman id 848683; Wed, 04 Dec 2024 17:23:00 +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 1tIt5Y-0005EK-1y for xen-devel@lists.xenproject.org; Wed, 04 Dec 2024 17:23:00 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20610.outbound.protection.outlook.com [2a01:111:f403:2414::610]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6875bdc4-b264-11ef-a0d4-8be0dac302b0; Wed, 04 Dec 2024 18:22:59 +0100 (CET) Received: from BN9PR03CA0109.namprd03.prod.outlook.com (2603:10b6:408:fd::24) by MW6PR12MB8833.namprd12.prod.outlook.com (2603:10b6:303:23f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Wed, 4 Dec 2024 17:22:54 +0000 Received: from BL02EPF0001A104.namprd05.prod.outlook.com (2603:10b6:408:fd:cafe::42) by BN9PR03CA0109.outlook.office365.com (2603:10b6:408:fd::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.13 via Frontend Transport; Wed, 4 Dec 2024 17:22:53 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0001A104.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Wed, 4 Dec 2024 17:22:53 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Wed, 4 Dec 2024 11:22:52 -0600 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; Wed, 4 Dec 2024 11:22:51 -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: 6875bdc4-b264-11ef-a0d4-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y90Y2MjkTusisFnjrDjGAwibOdxRwUHDXq44/e8mGqJDsKLGPDm6MeKhl7oqlYbdXT5SBOtB9dXxieaHC2B/+3uv1g4YBUymbQr1c82OgcUKIv/9BDAkxEyG0iVCQW0CVuiWob5dXl2rF+bxUIKVVit9d91zS0w7hwcT6HobAZgKfjn81GJqOXgCPxXomEB3tUbV+/9KWTIeCQXT/j3c721fW797B9tbsF8+RRaU5h8SyyQg600Mk44mzQJNCXB9aJy5cq1VaaVbdtS/GxuntXsrZ/q78vNLgJZdsPUn7XpdGrFFHX6pUAkSj6bf/J8ysIRq6DKOUNfym72e2QYisw== 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=eKRJlYZj/vM8lMPFruBRq7uav07apuOnarZh8uy17dk=; b=cY19GKTxKqgtNjjc4u2elEr+Z8O6NUFN4/kYPNeJJzP1ekdA6FW3m8KM5DhN5JRUCpbDLwWV/rtg32aeQjvsif/kyVJpEbPCcJ3xEH/pKFI9lnQ1LStOTPQqlIr3K7y3cARPq53m+SJEoN706+DNCfXZdKlCS0xqRCDBmVIX0pCNAx7ZGF+LWTtQ4jYb1BdJgqG9EBSsFSE4h7GgxNj2IfcRK7gHdVzXiliHV2YU2uz/sMHj5ChrYF3/dUwjD3f58UkL4zspqkeowsWJHX3i4wZtXUJ6GD92yzC4jQaLy1khvfmbga3teew179DyMPiw/qVjQgs8BEcSzvqWqzI3Xw== 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=eKRJlYZj/vM8lMPFruBRq7uav07apuOnarZh8uy17dk=; b=tK8GDlbkBvj3oBNdNWrsypxtp1Ff61nHvPXrKcVUGyxn7J2o3YaxHnQydBBJjttqqoMwrXUnkXVYJohDNhQRX/w54yIESW5IlDrGK5WjqcBlNsrO38QWFBIg9Vaz3QugqiAPjeNgOLehcCdmDo5E5Ow7QkvSjhyYC+PNRYvDOaw= 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: Ayan Kumar Halder , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Luca Fancellu Subject: [PATCH v3 1/2] xen/mpu: Map early uart when earlyprintk on Date: Wed, 4 Dec 2024 17:22:42 +0000 Message-ID: <20241204172243.1229942-2-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241204172243.1229942-1-ayan.kumar.halder@amd.com> References: <20241204172243.1229942-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: BL02EPF0001A104:EE_|MW6PR12MB8833:EE_ X-MS-Office365-Filtering-Correlation-Id: 31c31c7b-0477-450f-1b12-08dd1488494e 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?EhqGEt+ISUOHHSEDsCU9D9Lnl+gOPPP3n/WRHKvphuVpFNue3ZI5dFN53zf5?= =?us-ascii?Q?X+hquwNZYduPOKCt5i7A65eDZapSwb2pd8LVUaVla25QkYn2wkXUqT+AdX5o?= =?us-ascii?Q?oZVS/0M+8g5svuvjZ111TtYy3LJu9iQt5HltJXW78zLzQGidL6NpEx+u8PLa?= =?us-ascii?Q?UKjx2BiGt62iOwac0zjfy0HwavPa1GjLW/kp8i3o99Nj/tEJighQMvpQKGvw?= =?us-ascii?Q?rZdzwXUfU+MfL5LaXAmgTrTrYOb4HlX5yxCf+0O6Jufc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xoUbR/vT4wkt2RCVntFajGlm4ptWZiE?= =?us-ascii?Q?5pj8NSy/3oHR6SEu+JqiOZzbqmCmHTjl/agNriSSeA3Hc7fh4XsE7O+JD+Zl?= =?us-ascii?Q?r27dpTcma3vXaPnuETMt6iYI3OUTDxp2MY57vo/0mfG8AGOC1/waXTBrJIab?= =?us-ascii?Q?XUVD4Z2wlMo8O0Kg+x2bTdrkFxfBvoz0Dx+LXE6tdXzw8/lUFeh4Ge6UlsFa?= =?us-ascii?Q?t033wj/f6bCqrCSpeI33uLrv6UntZhlxepHIhC2+UgHzPQtiJjXlaN4YlZgs?= =?us-ascii?Q?XD4OzF54kQnBM5gefQPC6Yu37VfStCb9?= 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)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 17:22:53.3816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31c31c7b-0477-450f-1b12-08dd1488494e 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: BL02EPF0001A104.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8833 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1733333004343116600 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"). Also, it is mapped as outer share= able, RW at EL2 only and execution of instructions from the region is not permitt= ed. Signed-off-by: Ayan Kumar Halder Reviewed-by: Luca Fancellu Acked-by: Julien Grall --- Changes from :- v1 - 1. UART base address and size should be aligned to the minimum size of= MPU region (and not PAGE_SIZE). v2 - 1. In early_printk.h, included and fixed the macro n= ames. 2. Included in head.S. 3. Updated the commit message (to remove reference to R82 TRM) and added Lu= ca's R-b. xen/arch/arm/Kconfig.debug | 7 +++++++ xen/arch/arm/arm64/mpu/head.S | 10 +++++++++ xen/arch/arm/include/asm/early_printk.h | 28 ++++++++++++++++++++++++- 3 files changed, 44 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 d3db5e53af..e4f2021f45 100644 --- a/xen/arch/arm/arm64/mpu/head.S +++ b/xen/arch/arm/arm64/mpu/head.S @@ -4,6 +4,7 @@ */ =20 #include +#include =20 /* Backgroud region enable/disable */ #define SCTLR_ELx_BR BIT(17, UL) @@ -11,8 +12,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. @@ -140,6 +143,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..219705a8b6 100644 --- a/xen/arch/arm/include/asm/early_printk.h +++ b/xen/arch/arm/include/asm/early_printk.h @@ -11,10 +11,33 @@ #define __ARM_EARLY_PRINTK_H__ =20 #include +#include #include =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 (CONFIG_EARLY_UART_BASE_ADDRESS % MPU_REGION_ALIGN) !=3D 0 +#error "EARLY_UART_BASE_ADDRESS must be aligned to minimum MPU region size" +#endif + +#if (CONFIG_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 16:29:30 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=1733333019; cv=pass; d=zohomail.com; s=zohoarc; b=QMPUqXwjsqjiBllmLo/GfbezoaFJsiobcQLF9gvYh3rkFwUhr2xlExWmz8xreLCHhbJS2iLERh0ALdB0GncxlA70yp9Y8xEk5iYO4cmlwXWF0Jn/EyBTFTtyC10jV1I0yaWm5j9YXzENsrz/H+aCNGpogWmtGpVKg4cZwS9FkcE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733333019; 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=zkeSlG1x1nQlbLTNFU3f2etPFvJ/ZKq7O/4HU9Y+JXk=; b=W9AR89BGi28FipayHFmgPVCSbPzxrjLfTk21WzJ3/bIdxVlrkJNlmaozbacsy4PgXA+X7EemWRM++LzvZ8dfXJIjDbwYFAgv2dLmcJ8gwzNgadXsieiX9giNBOEAKeJV+95Q9LOtR8voXtCDe3XzxEmLWiCHKKswkDEfdvquRgU= 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 1733333019341284.80291653645315; Wed, 4 Dec 2024 09:23:39 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.848686.1263532 (Exim 4.92) (envelope-from ) id 1tIt5f-0005nh-B4; Wed, 04 Dec 2024 17:23:07 +0000 Received: by outflank-mailman (output) from mailman id 848686.1263532; Wed, 04 Dec 2024 17:23:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tIt5f-0005nW-7l; Wed, 04 Dec 2024 17:23:07 +0000 Received: by outflank-mailman (input) for mailman id 848686; Wed, 04 Dec 2024 17:23:06 +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 1tIt5d-0005EK-Ux for xen-devel@lists.xenproject.org; Wed, 04 Dec 2024 17:23:05 +0000 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2062c.outbound.protection.outlook.com [2a01:111:f403:2409::62c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c04c62d-b264-11ef-a0d4-8be0dac302b0; Wed, 04 Dec 2024 18:23:05 +0100 (CET) Received: from BN8PR15CA0051.namprd15.prod.outlook.com (2603:10b6:408:80::28) by BY5PR12MB4260.namprd12.prod.outlook.com (2603:10b6:a03:206::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Wed, 4 Dec 2024 17:23:00 +0000 Received: from BL02EPF0001A101.namprd05.prod.outlook.com (2603:10b6:408:80:cafe::60) by BN8PR15CA0051.outlook.office365.com (2603:10b6:408:80::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.19 via Frontend Transport; Wed, 4 Dec 2024 17:22:59 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF0001A101.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Wed, 4 Dec 2024 17:22:57 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Wed, 4 Dec 2024 11:22:57 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 4 Dec 2024 11:22:57 -0600 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; Wed, 4 Dec 2024 11:22:56 -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: 6c04c62d-b264-11ef-a0d4-8be0dac302b0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sAtKyBlUbfpqp9Mrx0EGP/XAT+ol6bw9Se4GsXT3jNIei1psgO87gNk2KnjiZoiTR9U4EmlJUXMTRxgiR9Hn0B9UjHLzmVNtKBpoV1F5CmDWQzYk8zGwFj8FIMyKDawDJI5gHjJRqzApjFpUX80cmYWpxLZXowp6cpL80o6URUZti3ugRuHVb7iOgof/6FX+jMzoLkYBbC5Lg351+TVYj7majS8k6Y4RfD1V/EPSBvB16sdjST9WOYxIqRfq9C1cKUcpueOf+nSpOKYcdUlDOIewoLmbZY4EqbKrg9/9RAazDGtOsSdXekksblLq7rONzQuVXVdPo3Qmf+6zP1/bHQ== 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=zkeSlG1x1nQlbLTNFU3f2etPFvJ/ZKq7O/4HU9Y+JXk=; b=eZJro7FIbQ9REmIYxPUmr1u3qaavdsCSDhiSub4g5GZ9NV1FW4sQH6w3+fbdAtnVQBckF/QRklhyqtGIJkMJAfIVy8zulLe7U7uQtRJE9MViNaN45wBITa/zimZ2VnATk3TvTHNRznBze6+AWkmVzi82LLuGoN6thJfnsxMpy+nHA/m8KhL/LjxaxA3GK+eCodg3kCx8ItkdixGROYSyTFSVyhM8vdBsCBu0wyEY7JaEbrTQlq4SsGWrs/Bnch7j8tkl5NVrAyb4ToSODmTDSQYUjxnDYP18wnSFftJshDHC32BbuGAvTSMAbIwLf3R0sjYpoMn/5GnXfN6ZpiwmEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=temperror 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=zkeSlG1x1nQlbLTNFU3f2etPFvJ/ZKq7O/4HU9Y+JXk=; b=Iq2I1CGUupXI+TMpCEsKM/hAtEmKMC6nISyrs34TMjfmNWvCKQ0qfBeDJS33+1GuDijJdI8Ib0p8M2c7Afu9UWjAhavCjHmeIDiJB2XBI6G604Gm35hpZajb8RGboxIJMawu2/L6FWh6d6vo8H0FJ8zpYY34/gjFINNwltaiwfo= X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror 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: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) From: Ayan Kumar Halder To: CC: Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Ayan Kumar Halder , Julien Grall Subject: [PATCH v3 2/2] xen/mmu: enable SMMU subsystem only in MMU Date: Wed, 4 Dec 2024 17:22:43 +0000 Message-ID: <20241204172243.1229942-3-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241204172243.1229942-1-ayan.kumar.halder@amd.com> References: <20241204172243.1229942-1-ayan.kumar.halder@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A101:EE_|BY5PR12MB4260:EE_ X-MS-Office365-Filtering-Correlation-Id: 6327af57-a15a-46f0-afc3-08dd14884c0e 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?wD9lowN9JR0R6D8GyMObCId7u4OTtpQGoXwZ2kcTjpJPLl2hDQqQ+BP7DoA2?= =?us-ascii?Q?fdbKiDmZzwBguXZk4PRnvqWZJ4JMa3gagiRUHE+JgNpfinewkC8+yBr66uXU?= =?us-ascii?Q?7XaCwpWD/KbYeCNYqIu9NPKb3ELXO3ZAqyON+J9WqevII9F8E7Tk/MkxcP+y?= =?us-ascii?Q?mYB6FfMHIvkZ4eAE/TBvm+c8OyIsjOpA5L5TgKj9DCABIrFCoGyZIgb2A46p?= =?us-ascii?Q?LRjkgPnLxc8nt6Xq9FKU0mfCqz9XDQJcXakXr62ZWQ4JGEiBndMOxouyKWSC?= =?us-ascii?Q?Vt+w43Rt6oHM8UNVs5Lg08YDVmwuo8qhnsw52ho5MvJPME+njKgXn6Bv6vFi?= =?us-ascii?Q?TNHFpTgErLoKTmJpwiQjbYv7dXl64NH8fPeDOGnWJksOTs0nYbSXmjOJTzVP?= =?us-ascii?Q?aNbsNsB6EiJHc1yTWXxYK9LY2z1fuC6Wqidn3wJMTf/NjwbGfd4FJoWBzlKP?= =?us-ascii?Q?qnqbx5NbKWub9IblTUwY8+qvWGX/q3WzwsJI7UZ2EhW1TjkEicCcYA6Fu5tV?= =?us-ascii?Q?EIdkZkUJg+PVub9KSXwkcJGy7tBFGDZOpi7ObRD5j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?GrJJguMsIEIGz4sbTuVVoQEvUuLLyNJB?= 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)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 17:22:57.9992 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6327af57-a15a-46f0-afc3-08dd14884c0e 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: BL02EPF0001A101.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4260 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1733333020154116600 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. v2 - 1. Added Julien's A-b. 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 23bbc91aad..604aba4996 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -15,9 +15,7 @@ config ARM select GENERIC_UART_INIT 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 @@ -79,6 +77,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