From patchwork Fri Sep 6 11:41:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Vetter X-Patchwork-Id: 13794080 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6605CCE7AA3 for ; Fri, 6 Sep 2024 11:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Content-Transfer-Encoding:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=HiAnJIoHpbJxj5la1hMTIQmk3Srj/8Pr4XZVaZQhkpo=; b=ktU1Np0UbGVokcCRtwe+H4x+ps YJgz+Y5G+eT7rreG+0x6SbDM6NyIrBCkMUrF3OnfK2U3f+6mJ3oETqSkyWa0K7dKvApNhh2bPhDUm Iw15gQazvalb5aZr4O4PtgzH3iL9uZi67cvoa8E+PseJXugUkm785RnQaVDRdEPeyO+xHt3OT+Knh gCEZzKOXHlBDeJmK8o2zkStlUS3fm4RmIlt8dDGUD181PMshSY3IE0CNyykhAYDBTybZc/+sJd5KE C2DPQwNmvEe5G/Q0oTPHsbfYpj+Ohc1MpcAelRe9XWwXFZbCNpx6o5XWAU2QBsnD1I1gmShJ7G06D vqP4o1Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smXSS-0000000C2u0-2g1S; Fri, 06 Sep 2024 11:48:56 +0000 Received: from smtpout146.security-mail.net ([85.31.212.146] helo=smtpout144.security-mail.net) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smXR0-0000000C2aY-1Tlf for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 11:47:28 +0000 Received: from localhost (fx601.security-mail.net [127.0.0.1]) by fx601.security-mail.net (Postfix) with ESMTP id 0AF32349783 for ; Fri, 06 Sep 2024 13:47:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1725623245; bh=jQeIwSeV9x5cNLkMOCKbfvh2gAzZ0rXmkbBIP4/OHZs=; h=From:To:Cc:Subject:Date; b=gmN8UhstvLsnS9m6obVAhFjBDNxB+zpKCx7ydSyygbW3N6fEzf8EH19p49KXcTaoQ zky/krWF/AnkrYj26DBw+gQEEWtMUeMcntL5Hr+biE278emke/z/czA39DP1rAPbKS FRolSjpG9zOrG2Bt03zyryPwvhy8yFOASNJfQ+yo= Received: from fx601 (fx601.security-mail.net [127.0.0.1]) by fx601.security-mail.net (Postfix) with ESMTP id 9F2B53497E1; Fri, 06 Sep 2024 13:47:24 +0200 (CEST) Received: from PAUP264CU001.outbound.protection.outlook.com (mail-francecentralazlp17011024.outbound.protection.outlook.com [40.93.76.24]) by fx601.security-mail.net (Postfix) with ESMTPS id DF7953497BF; Fri, 06 Sep 2024 13:47:23 +0200 (CEST) Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) by PR0P264MB3466.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:14b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.26; Fri, 6 Sep 2024 11:47:22 +0000 Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626]) by PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626%4]) with mapi id 15.20.7939.017; Fri, 6 Sep 2024 11:47:22 +0000 X-Secumail-id: <5434.66daebcb.dd4a8.0> ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LfOB1Qn50tmh0wKyHby8mRDcSdtBkXwvgOcqqDteXwQku+vwAsPrnGLqDhiTEMTNLBcd++Jamo0UQiOEmRvmR6pGGmjOx+G+2QNhF4/yF8fibZj/IkMOEVtWZCNIfgaN/RD+O6ZQyiFAfoUQ0Y7HALPrN1DoilRRzegKufl94LSi04tb2kL6a9X/tQpXCivG1QYe7+BhyUkTDWXG4kqIGOT4oZ88fewXdsh/z7bW79MUpCLglFHUBjBQk8jI9loOCWGHwI/FimVoO3pV2wu59Qw2W1jaISo/4fvgwBg/taFuhm2oPPIaJ35JQzWKRD5YMIPbIwIr+OskXpoE0l+kOw== 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=HiAnJIoHpbJxj5la1hMTIQmk3Srj/8Pr4XZVaZQhkpo=; b=i4qEJUQRmW/KEH0TlOZdgDFAnwiSD35Rib0/R1WjYtWn8lK76AmQfo4hOSprxLwqz6ZyEbeVA1q0FIg3AYFdQpCu0FC6g7Ib8INTAVKzGflnPXhqbuIfIzYX+rmC+NRggJYHcB7Rl6uTkeGNHihq5lMGZs25LCEnvosSn9T16r0bN5SBZKKgLhLvc3yWH9FDaasuY199MQfTx721bT2LuDQXfRu1WQK7CkJCkVtEsx3939UBVSu5THqhJK+NRpw0UPHiNp+79m65h1WAR0/g7F/9U+F0wxErGfgWOBacplmqg8OyzdV8G7vvpAaDjhjUl/YybLz4Hmclq03Bu1ildQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kalrayinc.com; dmarc=pass action=none header.from=kalrayinc.com; dkim=pass header.d=kalrayinc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalrayinc.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HiAnJIoHpbJxj5la1hMTIQmk3Srj/8Pr4XZVaZQhkpo=; b=hC1gjkAQ+yspNCizMHr1Xq/LGLySeTggjqzTej+o40u+ooXjsQ6CgqCVAGoc1aQsIWXSsWCgyn+BP3sRdWJtKYxRhPFceWnqMXwWKWFzMQwPJwfr1OoG04q7UH+BbKFlLelXmsr3SWyoAweaaOpVxbIXkRfMl1nWe2ySHJVQt3svPuylgVmHwiMGXOq/ju0sZEbAhuk1Mr+tdUkp8eI0edb+rTHWiDcGFFzNOPq8+hah5o9/xNUqJfEQh9CC2TUQ5j1VZ73/9aokrFYCzNTJ/RC+k5Sma4qoIeIRgDcVQ22zyyCZu8HAAMs6yksSJ43jJNxdCpaSHMceiO7wDkeqWA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kalrayinc.com; From: Julian Vetter To: Arnd Bergmann , Catalin Marinas , Will Deacon , Guo Ren , Huacai Chen , WANG Xuerui , Andrew Morton Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, Yann Sionneau , Julian Vetter Subject: [PATCH 0/4] Consolidate IO memcpy functions Date: Fri, 6 Sep 2024 13:41:47 +0200 Message-ID: <20240906114151.519028-1-jvetter@kalrayinc.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: AM0PR02CA0021.eurprd02.prod.outlook.com (2603:10a6:208:3e::34) To PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAYP264MB3766:EE_|PR0P264MB3466:EE_ X-MS-Office365-Filtering-Correlation-Id: 3afe11b6-8068-4afa-5312-08dcce69aba2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: NwmKa8CfwphrOkxMicqezozWgDxeevxNxwSPIbK8JdzErPooHv9EJGkt9MdBr9ugpGtU4bBMOmtw553O9ZvS9ClAmHNzJd/wPFEv0eN/G6obuBmnn7WnBYGGytq2dkci0xWxVFmgX7caq5DXQS/eL9V9BG85ZuhmotDumHha2NM1SgvWB8JwLD3gDzRrvdJLc1JCdJknuBzmrt3VXvuugeXucW5jiSDDv28muw0cWN6EzRKYVpFIi8wYo98LKq/eKdM+aWxVpjxWCEDElZji/5nBWkLgNXjIcLeHvMOKd1TuJimTIu+LU19dIn7DA46GpJRXCWYx7rfHFVy+I6zLr2QqQ2C6GkZotkVExHKwwJwLo/R5+LaUqQhoeuOCUr52X4C6yYmCL7GeoqJKeOLzMb2NVo4Ox4hF8qqyXpfaqCv0UnOm5n6piflAceQYiCyHdxOEM0yLm2lrg1ND/OAfDMSNKMAB/KWeSD6XrxUXHXFtoQAa+woK1m9QoDEXMkdY67p69qkU4u6hny0YZzvfnLkjsF/9BMnHX15hKtJSIan+8cBzxr0W6EvTqa/6BMCHbk5qFUFsk8H8D6R5YYiGIaCSi+70vFCHQY6agilSGbDO6zaGumkPmqUFZog/zEzvTD/arEXwEJBlS7uWz4j0mk4UlxMliZEQ+m3pJiwVlG2L0NUf3C2PTebp7fkyE+rEclFJqBTLP8d+T6TU+JP4hnpUkgXDrVeQaeCHJd2Tqdjxdfcu/r6P2kGfhKkXIHL29LGqcmpqRDEEOfzOgNVv0bveOogYZhZH8sIUIOC+BW0MAGXHP/YuqJJ/oCYTJcnBGMdVxHRB7dAkxFlsHK/gPjaW4FQJux9EWKQ3xkl5EFzteM700zZfFHziA2Q/axSudLMkJxSZbCZPpqzFzW8k0NaIpXytyJnvoSBv/Qik89pXCU61nszNY38sdWlHWOWk97B 4g228M75OLDBJZf0Fbj8fN/KDLRR+GKuH8znSWqFCPtdeoi2t7/jnqLEjT+sTMDFOTidZWllCp9uMv9c9kdjgndwAr8QDGJrS/y8ifwJ1k+5tchxFDu/5t5HjwfaZex4hc9VnruOkPV/k93cnClnMZBIui+dLL4dTAfFJKLqbbSHiNpYUkO/7uavLaS4010xDcDkbF5u+gRKsMOqyMDQ8sBbNTTsX0Xkw7G05XjzY8R6N72itibDMBUgqUUDuuNFBxQKTlogzYNmkm9KKfpvTnMKfWRYbAVDkiv3DtRk3YbAm+7JlV36BX9k3/QoUeWuXbCHvL/YgmGkb2RodR7v9sMvMaKFTfTItJMbBbUYU1ar6TjJmVuy/Ji3rwtzENM37oUU+rsOaUNgYn02hsC8TsLujE9EgcDasf6lJXzb7f2d2eTfISZePjEbMnQlPE8lyUt6h5h7RNL/9GQVpjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EEYvN/b/Cpp/Drow8JeRP1aQYJ7xkPXJF+SMj3Q3WQRiL7T8VnOdwyRzS/lajfWXxvQFpIT/4jRTZf+rD6MCtwJqmNgSgDr9ka/LLFYMIqbuVvgxRwdJOBp/LlIb/yLz/Uq33YAGwC0W1rZf3Q4xC21R0TWcPCKmywAOGsQeaiA5MSSKHf7ck82EiCcpi7Oi/OpEXkVFibC36ChRYltshbCWjBD6AhYjVrPWDRD2ID6CL/xgiyoTjjqYenhQ4iN/xwW3p1hWT09XjqgjlyK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OKMqr0IXJ35c9UfdibBZ12+3oDdqNn2VXjd2vVY0s+Kk5vBRA6844BwRaAp0Q7jN7c9/D2n3BetyxL9V6vfI4xX/LpwEEEg+C/wNAnq3if+HDePd/q9ia4CPw85PmHQm7lwcKnGUDL/iScrTay4RZFegniQxc7+V/6xFHdW2bvhM/YRXw/+C2/KYGpQWxc1hegxPJTEHtj4GjhVGjR/3gh9ygCKE6whlpJx8QPf20TDg4/1n9ka2EA6uUQC9jQj4GFHlEPA== X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3afe11b6-8068-4afa-5312-08dcce69aba2 X-MS-Exchange-CrossTenant-AuthSource: PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 11:47:22.7749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8931925d-7620-4a64-b7fe-20afd86363d3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6PXTLuLTQE8wbEVxomkrrfPWQp+/COsl4hU0dfs8x14troLalGYU/dTv26sb41lYSzOZzqUC3fljrBqzx/5/SA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR0P264MB3466 X-ALTERMIMEV2_out: done X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_044726_553269_29613E6D X-CRM114-Status: UNSURE ( 9.99 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Several architectures have almost the same implementation for__memcpy_toio, __memcpy_fromio and memset_io. So, this patch series consolidates them all into a single libs/io.c file. Julian Vetter (4): Consolidate __memcpy_{to,from}io and __memset_io into a single lib Activate GENERIC_IO for the arm64 architecture Activate GENERIC_IO for the csky architecture Activate GENERIC_IO for the loongarch architecture arch/arm64/Kconfig | 1 + arch/arm64/kernel/io.c | 87 ---------------------------- arch/csky/Kconfig | 1 + arch/csky/kernel/Makefile | 2 +- arch/csky/kernel/io.c | 91 ----------------------------- arch/loongarch/Kconfig | 1 + arch/loongarch/kernel/Makefile | 2 +- arch/loongarch/kernel/io.c | 94 ------------------------------ lib/Kconfig | 3 + lib/Makefile | 2 + lib/io.c | 101 +++++++++++++++++++++++++++++++++ 11 files changed, 111 insertions(+), 274 deletions(-) delete mode 100644 arch/csky/kernel/io.c delete mode 100644 arch/loongarch/kernel/io.c create mode 100644 lib/io.c