From nobody Sun Nov 24 13:00:45 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=1722600930; cv=pass; d=zohomail.com; s=zohoarc; b=DKmVyCipG2i0M57daP8tlEVblLrD1Y+XHdMSNb72zt5ap5xOr8L6wFtH6Gbh+kvzDQBNIAwwYiTi1ApFd+Jmq1Wi3r5mfW3L8RKfGjHvoZQoGPwRLDYD1pvmoyNZwI5F2nawrzwdogO+1OPz9f9oNn9T6OnD11ZeSoGhQPlEcGc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722600930; 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=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=; b=BzSrqqG4L6aqWhLAOpUIO8ycgCVUu53tbwAo6yxq7N4dRTIBvZXItN2QwNcVwQ04DUMxr0BK4w+qfk2qJa3EA1uLe5GWc+LizLOeT11xQHtbsZudlE1MXc9ZLZ02pnK2o5rsdD9k5GenixeFqnb/tDugvqfzmX7KIkHCXyRm9V0= 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 17226009304743.5183504967346835; Fri, 2 Aug 2024 05:15:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.771054.1181646 (Exim 4.92) (envelope-from ) id 1sZrBg-0003NN-TM; Fri, 02 Aug 2024 12:15:12 +0000 Received: by outflank-mailman (output) from mailman id 771054.1181646; Fri, 02 Aug 2024 12:15:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sZrBg-0003ND-Qj; Fri, 02 Aug 2024 12:15:12 +0000 Received: by outflank-mailman (input) for mailman id 771054; Fri, 02 Aug 2024 12:15:11 +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 1sZrBf-0002qg-7n for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:11 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20625.outbound.protection.outlook.com [2a01:111:f403:2412::625]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id dd1c7229-50c8-11ef-bc03-fd08da9f4363; Fri, 02 Aug 2024 14:15:10 +0200 (CEST) Received: from PH7P220CA0072.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32c::31) by PH0PR12MB7485.namprd12.prod.outlook.com (2603:10b6:510:1e9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug 2024 12:15:06 +0000 Received: from CY4PEPF0000E9CF.namprd03.prod.outlook.com (2603:10b6:510:32c:cafe::51) by PH7P220CA0072.outlook.office365.com (2603:10b6:510:32c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend Transport; Fri, 2 Aug 2024 12:15:03 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by CY4PEPF0000E9CF.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:15:02 +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; Fri, 2 Aug 2024 07:15:01 -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; Fri, 2 Aug 2024 07:15:00 -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: dd1c7229-50c8-11ef-bc03-fd08da9f4363 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UKrWA47OVwAZllrifdvyN+cgcSIDqdM1MG5hepUF9ujI2nffKoMNvzW5tVDz3KTpfndkhNj/9ftZ/PK0eKGv5QZREpTAJ54cVuspoyVGZ2/sLHsDnaPxxsLOeWiXijSfmrg3j8+DLr66d0/pxkZ+C+qUzUPnt7TAYRe1PLRmvNdZUtGQFKDi19Ul/ETadMnx9rx7lhOVxW73nroeqFrZInqXOLwfJcg/XXgpwcktGZxTgxwvgtqg10sd2Hpa/bxrJF8ngC83W6EAR2PEUc/Un4/OVyAEwcdy/0umRKmo+tzac0O7QZ6sSd4PwTD3JujrkszC+ydVSVF6v4NkxniG4g== 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=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=; b=s5Ci7QnURzu2TDqqaDr1RrFfgjmrZ9xIerqJbMEEBS9OOLA1rN8lw3s4cywh7UnV+sR9lPTUe7J6puKVb7YPa58od76QczKiNcrm5BMqOLcdc5ZbGZu3Nd+vVFFJ+uGOuOn+CzcVBq/gAUhk72kuEzCIHXzgB1rcSoUKUgjsVeo3A27c4rt++ewmFPEX5A903JBZJZ/d7Y6LWqj4QjNmpsPqov5UeYQ7cc1FxRmkYHigT8GYTYcMDQYOI/rMa96onn9flL7YEZou+XsO0aMhBTR5r6delas4vS4ow5wPNjHAZxuYx8zRu1XxyilEvCU+FrD0spZWRLWHtsXzi6i5bw== 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=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=; b=Vyj+iQVOPo/EgVYaK1RF0sf++A6GxKxq+5zhg3p8MWl0JwvdLRzpHFYFR4jd68O3RFc6swodpoDM6KuzpO63LzViKD4aVEQVIRojUzLk+fJDMNj8IKLvzrhyz+ZnBJkwlvpBpQc/qUSc4w/BDwN5GKBsoFXJ+OOYraQBqindlN8= 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 , "Wei Chen" Subject: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system Date: Fri, 2 Aug 2024 13:14:41 +0100 Message-ID: <20240802121443.1531693-3-ayan.kumar.halder@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240802121443.1531693-1-ayan.kumar.halder@amd.com> References: <20240802121443.1531693-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: CY4PEPF0000E9CF:EE_|PH0PR12MB7485:EE_ X-MS-Office365-Filtering-Correlation-Id: 35ae0cc8-dca4-4418-a24e-08dcb2ecbcd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GFXWBsM7TeZL3KJ6/PAvM3bzy4UIo8R7A1yMUPyi1MhFPdvxRCO4etI0haQI?= =?us-ascii?Q?R4bSLXAUYy1Lc4WGDoVUJfq/A1BNLylRUYFTocYL7jWwqC71BoSK83iYHdS3?= =?us-ascii?Q?y8eFuO7J7/YKVIt+OLU8PxKoUhntEmKLVVLiscZ38Dh4giooT7RZT9AttzlN?= =?us-ascii?Q?benvv1lTR5rK4APKSYeLaQxLmXFNN4yjwjKYh72Nm/u2C8QVqG0QhtGX6iKW?= =?us-ascii?Q?iYxzOcM7LpD2R2PFWJw0FqKtV62+uPswx0Xc3R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B5aqcafTzAsE1VXGDXLZ+48eI3HCICkJ4QtlsMQmhAL1O?= =?us-ascii?Q?mR1JGsxm24HXySyTo2CNPl1lA4MnjveMlJlfU8gopK/ufgp+8D28eD6WmFPg?= =?us-ascii?Q?e2Chcm8VM5aVuRYupggh0NH/Uv+Bpqmo/iShrCOpqLbhB6mtixIBwkFBaS6Z?= =?us-ascii?Q?f01fFsQrVi62hWUb+qa9nKCVKDBF+OyURIrYJrXYxmu90SMQTvLYSld5p2xy?= =?us-ascii?Q?udb1xxtzFgosx5eUzBxrYRacltFrHrUP3kXy2dHAmDRR14vsfg=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)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:15:02.8036 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35ae0cc8-dca4-4418-a24e-08dcb2ecbcd5 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: CY4PEPF0000E9CF.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7485 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1722600931681116600 Content-Type: text/plain; charset="utf-8" From: Penny Zheng VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc 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 we make features like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP. Split "https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.= 2943270-16-Penny.Zheng@arm.com/" into Arm specific Signed-off-by: Penny Zheng Signed-off-by: Wei Chen Signed-off-by: Ayan Kumar Halder --- xen/arch/arm/Kconfig | 6 +++++- xen/arch/arm/Makefile | 2 +- xen/arch/arm/setup.c | 4 ++++ xen/arch/arm/smpboot.c | 2 ++ xen/include/xen/vmap.h | 6 ++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 21d03d9f44..c8d417298c 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 @@ -58,9 +58,13 @@ config PADDR_BITS default 40 if ARM_PA_BITS_40 default 48 if ARM_64 =20 +config HAS_VMAP + def_bool y + config MMU def_bool y select HAS_PMAP + select HAS_VMAP =20 source "arch/Kconfig" =20 diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 45dc29ea53..6882814d38 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -11,7 +11,7 @@ obj-$(CONFIG_HAS_VPCI) +=3D vpci.o =20 obj-$(CONFIG_HAS_ALTERNATIVE) +=3D alternative.o obj-y +=3D bootfdt.init.o -obj-y +=3D cpuerrata.o +obj-$(CONFIG_HAS_VMAP) +=3D cpuerrata.o obj-y +=3D cpufeature.o obj-y +=3D decode.o obj-y +=3D device.o diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 0c2fdaceaf..9d34ac7f64 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -804,11 +804,13 @@ void asmlinkage __init start_xen(unsigned long boot_p= hys_offset, nr_cpu_ids =3D smp_get_max_cpus(); printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", nr_cpu_ids); =20 +#ifdef CONFIG_HAS_VMAP /* * Some errata relies on SMCCC version which is detected by psci_init() * (called from smp_init_cpus()). */ check_local_cpu_errata(); +#endif =20 check_local_cpu_features(); =20 @@ -879,8 +881,10 @@ void asmlinkage __init start_xen(unsigned long boot_ph= ys_offset, * It needs to be called after do_initcalls to be able to use * stop_machine (tasklets initialized via an initcall). */ +#ifdef CONFIG_HAS_VMAP apply_alternatives_all(); enable_errata_workarounds(); +#endif enable_cpu_features(); =20 /* Create initial domain 0. */ diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 04e363088d..999afc028e 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -406,7 +406,9 @@ void asmlinkage start_secondary(void) =20 local_abort_enable(); =20 +#ifdef CONFIG_HAS_VMAP check_local_cpu_errata(); +#endif check_local_cpu_features(); =20 printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id()); diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h index fdae37e950..84797acfc0 100644 --- a/xen/include/xen/vmap.h +++ b/xen/include/xen/vmap.h @@ -138,10 +138,16 @@ static inline void iounmap(void __iomem *va) /* Pointer to 1 octet past the end of the VMAP_DEFAULT virtual area */ void *arch_vmap_virt_end(void); =20 +#ifdef CONFIG_MMU /* Initialises the VMAP_DEFAULT virtual range */ static inline void vm_init(void) { vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end= ()); } +#else +static inline void vm_init(void) +{ +} +#endif =20 #endif /* __XEN_VMAP_H__ */ --=20 2.25.1