From patchwork Mon Sep 30 13:23:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Vetter X-Patchwork-Id: 13816550 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 45024CE8347 for ; Mon, 30 Sep 2024 14:09:29 +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=a2kFgx3OrKGb95rD8xCYpED1FNXXzNuS6G1ZkVVXriY=; b=TRlDLEyBURTpiyxXIgkkPfAzcd F/AugHEFk0HoVscZt2AAsTfRKa3uXu1VT6favLrIIoqVBir3sT/z8kzhNxuWxRrfJww0cxKeTSw2E V/tZ9vX7K/cQnMJWRDsFw5td5WQdgbkGF+G+sLkKgz9lr/0EVUetKHThVp/mzT4Ro6ZrMqhU2JDS9 rnaZfgXURk+K5FElkvCGXAKUHYHYyuaLp+gjYuiHH/H7ca0Ei1OZRoEjrLlfhRj78MLtoUo/gMI4a ZLe0oyslA0YTPy9B0RpID0R7bfZYskRsz3R2ebyVFXNW2CAzEZi5+LLzaDUPMc4a/ciwy+Cd/sLdF ZkkkRNuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svH5U-0000000HSDy-2dw9; Mon, 30 Sep 2024 14:09:20 +0000 Received: from smtpout147.security-mail.net ([85.31.212.147]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svGPU-0000000HHzh-2dqk for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 13:26:00 +0000 Received: from localhost (fx409.security-mail.net [127.0.0.1]) by fx409.security-mail.net (Postfix) with ESMTP id DDA01349743 for ; Mon, 30 Sep 2024 15:25:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1727702754; bh=CuaNgoBj7v4blNzKfFjWE0ZeVmzUEMMewgXdROghgU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l/XuGBWYQsS5e7vCBFiR8p4o5TCUovvXqyxKuoakK6DOfwS0zIaQeBZ1HYb1wl0Js iMZ7246ULWFVyWvn00Ne4uhJijGA2xRPhJLR5jdoIiy8X2F0Jgne6Wn21TgYMlOm4a sRFBkeDAHDaOeEu8YiS4uWEsMRDbDWUY2iRyStXM= Received: from fx409 (fx409.security-mail.net [127.0.0.1]) by fx409.security-mail.net (Postfix) with ESMTP id E7E733496FA; Mon, 30 Sep 2024 15:25:53 +0200 (CEST) Received: from PA5P264CU001.outbound.protection.outlook.com (mail-francecentralazlp17010001.outbound.protection.outlook.com [40.93.76.1]) by fx409.security-mail.net (Postfix) with ESMTPS id 173183495D9; Mon, 30 Sep 2024 15:25:53 +0200 (CEST) Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) by MR1P264MB3380.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:21::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 13:25:51 +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.8005.024; Mon, 30 Sep 2024 13:25:51 +0000 X-Secumail-id: <8771.66faa6e1.14b42.0> ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eQ36pEGSgSs6ZY9QZwmKy+EBKZQIdfZW2nATql7cG1bVyluO/lybVBcJ4QENP7R6VBgP1TZZ+fMZyOZnDq4NjFMXgSaEeHtZ7SrznO0eRY4ITt4GGS0MkO8/z64o5uqH1FuCI5hxvpwo4T7PG8t8L4wXLAEtGYqiB1lfg+7US7gfeBjfS+6z6rNoGvOWx6GZ+P9Tnp+2d2UNdyunuwr0FUDH2xEas7JGpucx6dtQVVaIZFSILF7uF0N0FHDnN2kAPTZr8OCyjOAxU4CO48R5BpHiLdcoS0tk6PAeJeN/eNYb6ocR7fKvM9m1/Zu7qsvBBgXhSPKh2W8wehBcG/bttg== 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=a2kFgx3OrKGb95rD8xCYpED1FNXXzNuS6G1ZkVVXriY=; b=E4X6p56B0/KK2fYxyGk3cD9xxZLcHnGLWbfan2wR7L0pzxzAhWnUMAycEZwGrfw8dMgOzAQLfeNMbNstzn0ePyb7gzD2JqdlgNVfS8mERvfMyHB5psTHQmis+17732zkZJkrhsl2LH/wNQhTwzApWrLJl6oCRi/rmR4dVMRk44GhlWUFQ21LzQ3EX7Skqtkt79t8XJMY0K6xm0n88JqQ+YEpDH+Oiq8aPhFOcgDjnuDpKJ7NDPXKOKUlBZGhL/IqmGlENoFzotgcdlPYP5XgDOsHjQpA4ahjiumpXaE5F2lf29bFTTf0UM7rvDfMK1fMwKC2uLOM5I2odaKgfBV5uA== 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=a2kFgx3OrKGb95rD8xCYpED1FNXXzNuS6G1ZkVVXriY=; b=l5gvVOV0ME0roygqYyc0B53P3TiBBSy9Cz8+T4BN79cd+9YORy3fnZkB7bDeBVBZy5PlzL+3+sGvBWL+R0+sJ8p9z/nAQPISKVkhc6iYxJmOX5o5qqzyEsoFTdYWb4XXZK+lotfHPTI7fofp77c5AC3H7oxzv4O08mK3TSM+HGFKkPFJV3shL8H/p7V1fzWRJNRcLIxUACSnRilMb4tCDqKwr16uUpc+27kCBJnm27qJKkMEpq6pafKvA2iwtLzS4E8hsuz9jXQm4aHyvl1JNKQ5KCi4eSaCHc6RpchPnlH8TlFKcVf9Aa/LXxoT3PC/D5oYPZka7qF+YsHi+/XWQg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kalrayinc.com; From: Julian Vetter To: Arnd Bergmann , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Huacai Chen , WANG Xuerui , Andrew Morton , Geert Uytterhoeven , Richard Henderson , Ivan Kokshaysky , Matt Turner , "James E . J . Bottomley" , Helge Deller , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Richard Weinberger , Anton Ivanov , Johannes Berg Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-alpha@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, Yann Sionneau , Julian Vetter Subject: [PATCH v7 09/10] um: Add dummy implementation for IO memcpy/memset Date: Mon, 30 Sep 2024 15:23:20 +0200 Message-ID: <20240930132321.2785718-10-jvetter@kalrayinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240930132321.2785718-1-jvetter@kalrayinc.com> References: <20240930132321.2785718-1-jvetter@kalrayinc.com> X-ClientProxiedBy: AS4P192CA0048.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:658::23) To PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAYP264MB3766:EE_|MR1P264MB3380:EE_ X-MS-Office365-Filtering-Correlation-Id: aac416ad-a2cd-4e99-766d-08dce1536763 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: LI8ZPFclKTl5xU5wCc8mTuw/lE96ZR66Dt7zRXmXjreWQuZuRemU32ZvPIVxz3oTlwZBGY70WnGpRAkaSJE27fIsqoM2enjcAUjbSB8UQ9lshVQOYpBEQSSmwVv0RHEyChviuQ/qMJzoOybHvLMTvnzuypbZvEA44/kzlvHnUsbfE5gWKMTFNg3lIx3DT5sqgN+wmR0sLylB7jsOcS2TAiun9+OGBVihDW7b2wNW8+/67Pu28G45/5XhdqOgv8n/JaDQujY6555pk9sL1J/FnnK+AudPnO8IXpcoeL3ddnngDdF3aSslyYyJ1Z5nTxltJHAc1ifRxEI9+0jG4nRiFzZxROIFLCHFkedFsBA+UqLOx/uct2BmkkRDhoxgyqdFzX29gClI2u2+LcMxVX7naAhuG/Mmips4pe/XeScW3w1cQG30VnZxkZz+l8Nd/lHSXtUiQuYaQkLs2KCzFIC+qQJKAEzqHSERhaEqbPkiDXrVu7D6SlHGXQeXW/nY0bkLYOeEcu4NXGhb5DDumfJYT617XmGWspqtdVaHWDhVpDf3Nf8IkMVWWpiI4BqOEJrsRjNC7qR3LkOLHtjeoP7JVbv8RI7kA1ZcADzvu1zKGtDAeRyKO/WZW5NbqPBq/cF5/wd15xweQ0tY8XUyugCEs4Kocm/bVLlKkoAfNuatSejzihqUY/e9P9MLPHsvDNXWKYVQxcMw6j4EaOaUrNEZ70VNp8Kd2LmafseUqDZHZDnqhECv1qMp/siOgYZkukWDKlfyFmuY2NjxaggFITExKJLmd4Rl07doK4hckjO3SRx3F3tnfryVeA6u1oegX4ZaG8kBlgl5gWg0+JKSaeV+ogbJVTYdmwVngGtFu+MfY7Od+iHOgd8TMnM5yeuPxOkdovMOojUwAGl/wRg3tNT4dSZAi3mJTfpueND0glIOIYgLMw8sK4Z1OSoLbv7URltoh/I Vk3gGVeNTWPKHSJvFxYDL09wQ4PHusx0eIilTvCzfiQ6s3HFcRpj9eaiurq4XVip0rg9VqKEm5BiwFMKK+6nxN6yew/6YXhi3KbCEAkWJhykd1zjzKSNK9rjGTN9z8YZcvTAYSb9xUxYNtZOiSG56+gSrDJIVO0PtcPb7p8C7Swet8JOLFUJJfNIkdxyYtWTTeKwTMxMzH8Hotm63+lLsKitEwKMHObRl/z/ZvThYNpP3xcRgGzTkcTCNmWbE9VQ6zd3eh2DCwb4OVD9mFBDoo8Y855XxUFq9vSDPeUOuw0CpEPzBrwk6TkOdaKlkIBqJpnmWE6zyzRsPfxPf7Dj8Yp3F+ObpCbK7VNycnbR3uahHCgBA9cBS7Flrgtd58sopCDT9NutTnqcKG/+gFLikoLt5xPISDTxsbwgH/Ms= 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)(52116014)(376014)(7416014)(366016)(38350700014)(921020);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0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pYLlFAlDlZn0IbEj24vD2Cz2KKE3pxY/OtI0p4922Mg08uKd0hIjWfwwFkpEy4C5Gn+6VHamQfLCUGYZojRde6CLQnP9UlCiKjvXWdGXs01aj5HGzY7aZ+q5toNgfM5AnfDS0RLBfPu4c2VeFGza8k646GvPs4BXH9iB5bmA2BaO9DzdXR0f6ADNC3DeHVsr9UxsKXal2ToazAz1D+FGksI1qGRKtObG8iaAVT2Rc6xGnSdc8wNYwVhsxfSzyFe9L7JZQ4OIRzm7L65FJJHUSrLpbx+KUOYCQMwIzuQi9tPe2dzMP/mJkbGvO6NgaxNMB8bInXi9pFqvg6jTB/KcwPPfRbAYfwtf68R8vqGbcdE0cYk3s+57kN9zdFgZ/uOd6mcRGgcbWMTcnm/ubB2GKe1OAkepYWhyyp99iNHsBere3+2mxhw5iaJyiR1M82T0S0kHZ27TbAOt8+q3rNa7Ahf8FfMETTrFmPdMYQvY277sGwHc+p8QcdWttmxT3mSQ2NvayU6IWEINAO7ejif35jF0dgfb5rHzDBKiO+Olw== X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: aac416ad-a2cd-4e99-766d-08dce1536763 X-MS-Exchange-CrossTenant-AuthSource: PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 13:25:51.4124 (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: OfUq9OYb9VLcx/SkvEWJ8eaFZY6bHvzjcpncZLGrW5mE/dkB2zoOkphDbhtS3tXq+0w31Dtp69m/dmcjp9qwlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB3380 X-ALTERMIMEV2_out: done X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240930_062556_942621_E6D0DF7B X-CRM114-Status: GOOD ( 11.29 ) 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 The um arch is the only architecture that sets the config 'NO_IOMEM', yet drivers that use IO memory can be selected. In order to make these drivers happy we add a dummy implementation for memcpy_{from,to}io and memset_io functions. Reviewed-by: Yann Sionneau Signed-off-by: Julian Vetter --- Changes for v7: - New patch --- arch/um/include/asm/io.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/um/include/asm/io.h b/arch/um/include/asm/io.h index 9ea42cc746d9..f02f40609798 100644 --- a/arch/um/include/asm/io.h +++ b/arch/um/include/asm/io.h @@ -21,6 +21,23 @@ static inline void iounmap(void __iomem *addr) } #endif /* iounmap */ +static inline void memset_io(volatile void __iomem *dst, int c, size_t count) +{ + memset((void *)dst, c, count); +} + +static inline void memcpy_toio(volatile void __iomem *to, const void *from, + size_t count) +{ + memcpy((void *)to, from, count); +} + +static inline void memcpy_fromio(void *to, const volatile void __iomem *from, + size_t count) +{ + memcpy(to, (void *)from, count); +} + #include #endif