From patchwork Wed Sep 25 13:24:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Vetter X-Patchwork-Id: 13812012 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 B5D35CF58C7 for ; Wed, 25 Sep 2024 13:27:16 +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:References:In-Reply-To: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:List-Owner; bh=2kreMTXDFdHxSgKTqM10ticlVWn9TtfUGl14nZSZMwg=; b=kKfvv5UEYKRkvWhzeAzPtL3pT8 2N/ERT5JOKK3xNmgh+LmMPaeNoTzQRz/iT50LYXKHV5b5dG8q3WrneJOAn2Eks0SlGaMzicj/AZ2e /HrmTvXKTZw9cwNA3CPNEeMpn4Db70+EJOnzFuZEKP9Ka07j3xO+j2kYr4ONg+e6NfztNHDF5ZvBE H7qjra9Y3cLuLnTZus0ODtBXH+mHb2eH0XNXED459pvtImNIMmSwzta0tBgLfG5L1WdrPMxyOSDcn Xpr8P/+jCHOa10Z0xPIm/rj4RBEtFQDlvWdLiv97j8Rd0n5J2NoDBGVX9Pq0e7yhpZZfdcN3vYZ7j QsYnOKFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stS2r-00000005N0g-1rqu; Wed, 25 Sep 2024 13:27:05 +0000 Received: from smtpout144.security-mail.net ([85.31.212.144]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stS0X-00000005MQ3-0iSz for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 13:24:44 +0000 Received: from localhost (fx601.security-mail.net [127.0.0.1]) by fx601.security-mail.net (Postfix) with ESMTP id 498343498B8 for ; Wed, 25 Sep 2024 15:24:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1727270678; bh=zXkNG46BbYzpGMMLDAN/iEUBb17+6yn1qe9DLsAMZnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PMIHaVzPKXOZlMS5qT9o+rYBRDfUvdw8fRucQls770n8Ch8HXjdxP11r9v5YRSXiS 6fu579300gpqmLLUYZmxEnPterM/1XS34B3AazzYq024sGZ9wpgEGHcWinOtZRiqky BbT9tuv331hVX/dlgJc5dfXEE1AKVbosyVyR3yFw= Received: from fx601 (fx601.security-mail.net [127.0.0.1]) by fx601.security-mail.net (Postfix) with ESMTP id 0B7B1349843; Wed, 25 Sep 2024 15:24:38 +0200 (CEST) Received: from PR0P264CU014.outbound.protection.outlook.com (mail-francecentralazlp17012048.outbound.protection.outlook.com [40.93.76.48]) by fx601.security-mail.net (Postfix) with ESMTPS id 6B421349608; Wed, 25 Sep 2024 15:24:36 +0200 (CEST) Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) by PAZP264MB2543.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Wed, 25 Sep 2024 13:24:34 +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.7982.022; Wed, 25 Sep 2024 13:24:34 +0000 X-Secumail-id: ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TgKuJ56s/mzAA05eOIPF0f58ROOdpdoto90aOc6GP0TkOr5iuil4xt+UXauaEnxPOVeOp14tsRb1l8QUYFgf5P8JQj4rRcOKDQdJoNvwRv3JU8omlX4ckz2nd5q3t4YXiOKwGy01MD2io9Y/wFE7bGzowmCgqlLnBHLEjtGRwXw64PWEM+b/6RhbLUUEIxrRsaePLnKhCu75wk0NPUYYDFrKIzyGhTUJ7acz38tqXrm7wpQJ89yd0QSt+K6G56wxJAQ6nTXneuV0jrZ1rVh+Psx6rKHQZY4+LMzMXVPPiDOUex7bX22UAUmcTCK+1SX/pNIE9U5JvuJDx3FXs9V1Ew== 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=2kreMTXDFdHxSgKTqM10ticlVWn9TtfUGl14nZSZMwg=; b=HQxTFkqTJ7W0JXZvi5XXCYqUxBcLa0efejjCzbXSnBAJsUGalFV+wS6KKaXEVta/ndaSZrYtnL5591R9krAZ1jN4+/8kIKGddAL/hKc807F1D/MVu3agSVt4LyXZUHAtHYJDLIa+ZmYAry7LLqmItt/ch1L9m5EdhfKhA9cbnLJZC3RKFxXZIMnsnf3h/30XvB/qZIEW8FgC59h1E+3d0CRvmnnnGMmxCIKE9oqG8rXtBfTfVQf4UsddIKK8OLppTGfpuQ7JnoYhzNDbkX7mSNpBGQ51dLL+hTf3fc8j3KZRXyvRddJ8nw+VM36aUEt4CpI/EblB1vLQDaRIzDRj6Q== 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=2kreMTXDFdHxSgKTqM10ticlVWn9TtfUGl14nZSZMwg=; b=QprVEam2YGpDGd6E//O5RifT5v/XpXNpHx3WyigSRqmGxQIO3a43iAsBEyKw6mW6E/NJLQ4MV2XzdgldzUKrz21PcD9RHZcW62oWkJdoK1I2Blxx9keGE3z5SBVfv/pqDaWj+NVp+jC/AcF+le5W+mnEmKttuoqf2yXuFj7sXVf88bbJdiz1Ha5zv1KrcYf9dTPK+2jwQxX+zRHaOf1Xl1ZOvms8/inNoO0NOiS4sp0agAEC6sZQddoSq8PkG40kOblIAZwWEx7fPh0m9oDkgLZanv+Qhjo9jGSQlFxB3VvzVM70gW9arHmT3ZkGa+2T/q0KP8rQiP8ZIp1xbl49kw== 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 v6 2/5] Replace generic memcpy and memset by IO memcpy functions Date: Wed, 25 Sep 2024 15:24:17 +0200 Message-ID: <20240925132420.821473-3-jvetter@kalrayinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240925132420.821473-1-jvetter@kalrayinc.com> References: <20240925132420.821473-1-jvetter@kalrayinc.com> X-ClientProxiedBy: AM0PR06CA0138.eurprd06.prod.outlook.com (2603:10a6:208:ab::43) To PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAYP264MB3766:EE_|PAZP264MB2543:EE_ X-MS-Office365-Filtering-Correlation-Id: 03de4353-0b2c-42aa-ed59-08dcdd6565b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: xuwEcpuXQssjt4Uy1GJ4VRV5zv0WozvFG5k5T1K1FAZl6Z2v7UihvKAEEIRawn1KWZEfzE9gg7KZqCU2thd8VHaTla3eWRd9jhp6l/3V2czGiJuFhm/fYOpblC7FrpxJV1NQAAcE0j/NkfabMEXyLIw88wukhk5FUPGPiglloPOHrlpPqBfaCoYitM9lYvV38n4gFyZMLLc5oZaiS3vtH+anPZsc0gGekNxgH0sMAFaaQKbrucy4+CUEG5FadnF8nDrIEtlhViPUJB5E60C0MO0aztam5Tm/KFk2iSPWR5x1kwRoVqPJrLMaFO54DTKORRetV8DENNwv2iK9WhJgIYK+EpyKopo7QAkx/uWudpACNvGG4Qk0HIDWljEPGcySlpGWhiXvKR4ElwHgf5NRmxosKXE9eETmrGuH4tff51TfpTjjfkU+KxzwplsslrUJIGE2f14pCk0kBhEZxP3dPM7hoeeHWduOBdSSxdmd6lOyBDa3O+ZUvoQz9HdUdaZfsjN4OaYxPGr1dZMMtgXjAgJlRmcWrkFmBVQaNuReUqrhwBX8NrG5FuO4Jy9mgOLEFPZq35Tt1l+rDl3+SuAsO6y2Fh4bsgeV2Iqi0gbIhWCJ2bvki0fTKX+VqYMqpyBwbEK56OYn2sZkjZxWi+M7REQQ/o9rAsXdVOoXW5o1MAacf2J64inKy49ia3s6Lb+6UI3YnzleLUHf8NlR5+9Du9vjpIqyDHcgOzRA5CEcI2yRGQRPWJF9emJ5lD8t75NIejo3F0x/7OE//3n5/BkGHLyQ4g36yXbr0xQ9MBdNYi00sI2pZQQfxRyXm6c1ICsTHSzVpq1kGW8Uoiu3PAQtcc20a9dFuP61R0+iDXSCqiR0RpEj1sKKso0gFxpvPDArt/CrRd/dk5ucPsY+kyX6ktfI4grwdRvPYwI/xhlMQEO+T1k22W/DJ996AQv6gn0jqyM yQdk2eSOdlVAMrX6t/IaZ8ZCJr/kCqC3OvRDlZrzqhxf9Ok2sIWk/p9BPXZ/5TkyR5OQkf12/hY9NH5f1i1ApOoydlGwp/o03uUtyw4cObWRl0myCD3T/VTsldfQtHH4DCAQl2kg8no3S2iY+Ujd8zHegLNRkHzsgvtFX3miJkPwtBVDfjaLRpZOuqOtsKP2TP97EMQ0bmE8Zz5ax0lhFtxmyVf7XmpXGEy5fNItqIqpWbI7xUzDb3VOX2+QHRs4nq0GdPBYBIFdbYnD+1wUovBSEBQmIqilTyDHzDG0IckHAWbL5UH1deb/wQSDFxHWmUeEdX7JKQExditWYZvbXHRIKCDyiYh8jhIFuUWpFis/LrH6npOdonPhSR8sXhJ1+XVRNR9iuYGaCdnMszPYdWDWNYAOEoVFvM5ATfPGsvEdWYRZmgeh44SPnRDgCRHhFJ0lQfQTT7UFyNEBhTg== 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)(366016)(1800799024)(7416014)(376014)(52116014)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XuYG9tyQyQNZ6YjnXFKCuFHq7lFA78XTyudvLh5GOqLov1tRJjJsqQVIfIsxaTlqnv0moBfR6Wh/n21Osyn506PmhqTjds6LEIfO8v11kOqnteovczAR+3Bh+tSn8O2v3kQ2jEMttY9U4S70+K7gDjja7ZohbK2y+7ajCNvCDABkQ5Z5BCVNrLrWwQ+v7abS4hX9/OZUfA3jHpsbjWzfM57BWdAOh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DmSmcSXqeMwKJr0XSnfKWUtfPNCJZP1rbvjK38pc01/BC2BnbIXJG9ud/dsMwn2D4loVbb/ElaEE7WMp8D6etngR/+bn51+iVQDpVKgVKZzjpk2BFwv+usA9p/69+ntdv69ZjqkQ1LQXYPWY82vSd+ITNVfWV8Ejclpd+cpFcVDzu3gIRwOR0HDkFRGingjqpqp95hL5PFlw6PXCBSH5eMe7Dv08yYS18eKft3umSI0rjx6+whvZeFi4bzCFSdIl+MOjik4X4inID1sQeEocT7ybH9RZNvIWdKBD7NzxzBQAZD9C/h2S3g9rCn X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03de4353-0b2c-42aa-ed59-08dcdd6565b5 X-MS-Exchange-CrossTenant-AuthSource: PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2024 13:24:34.8428 (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: wdcAeQm46hRDCCjbEjnnC0dfWlr0k8JgMP6mSP/432qmfzQR861vYSpqUfkdi5VT+EjfM11o7THf7QHE9gSqtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAZP264MB2543 X-ALTERMIMEV2_out: done X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_062441_885085_2B7AD7BC X-CRM114-Status: GOOD ( 12.49 ) 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 Some architectures implement their own memcpy_{to,from}io and memset_io functions, because the generic memcpy_{to,from}io and memset_io just use memcpy/memset.This commit replaces the generic memcpy/memset functions by IO memcpy/memset functions that respect the given architectures alignment constraints. So, later we can get rid of the individual implementations and use the generic ones. Reviewed-by: Yann Sionneau Signed-off-by: Julian Vetter --- Changes for v6: - No changes --- include/asm-generic/io.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9b8e0449da28..3b7deb724a2c 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -1175,7 +1175,7 @@ static inline void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) static inline void memset_io(volatile void __iomem *addr, int value, size_t size) { - memset(__io_virt(addr), value, size); + __memset_io(__io_virt(addr), value, size); } #endif @@ -1193,7 +1193,7 @@ static inline void memcpy_fromio(void *buffer, const volatile void __iomem *addr, size_t size) { - memcpy(buffer, __io_virt(addr), size); + __memcpy_fromio(buffer, __io_virt(addr), size); } #endif @@ -1210,7 +1210,7 @@ static inline void memcpy_fromio(void *buffer, static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer, size_t size) { - memcpy(__io_virt(addr), buffer, size); + __memcpy_toio(__io_virt(addr), buffer, size); } #endif