From patchwork Mon Oct 21 13:31:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Vetter X-Patchwork-Id: 13844202 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 BF1ECD15D96 for ; Mon, 21 Oct 2024 13:57:01 +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=k/Pgfr4aqWNaoWCaK9VM3FAG6Mrhm2a/4ETZWcrPJJs=; b=f/rrmoA//7M3z0SSFbExxQ7WSD y18KjQv+FsLqLjiMS62ne/EesGYW+iMp2V7jWp93vU7xH0h7OovDQnbUOr1cJxdmYSX6LYudCzz/W hUtVL7GheEHMPDgIJ8k0G3hI/j4m10xEzWgNhP/njA6vMZRIsT2kcChmboMS6YmgdRw5isuVOxlu1 bhJPuNMziHLWMbSuiN9Eza1mifP2Wn5Ocfv8I8Nmdr/cfYfOhIuRbzh+vFo8YLtXpodE/uq9tEf71 A37ArNd+mrALIVHG3fMA+DpUghRIL6hA1rKh90D49GlmdSk6VHzLA7MSHYgLbgFPsq82oLfM4sZ7s RIQHsXUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t2stv-00000007W4z-3U5G; Mon, 21 Oct 2024 13:56:51 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2sXS-00000007Qjw-3na4 for linux-arm-kernel@bombadil.infradead.org; Mon, 21 Oct 2024 13:33:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version: Content-Transfer-Encoding:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=k/Pgfr4aqWNaoWCaK9VM3FAG6Mrhm2a/4ETZWcrPJJs=; b=coB1BGfUKiGDTWxlZrMhxMYPez T9o7PHyutbO5FFs4Ej7Ue+YUGe+ZCqLN13OvJ0oBcGvGHxI/sAYV/1gnvF/dgnqSqwZxE0t7G66mI nv6S1W/1DV9F+ar1phsHAeoIsXqBUdm0f0sqWSkiLUWnCfiexkQbQvyBcXTaCLt2Ahp2dzg/1QAxJ 8Y3WIeSz2rcQgp50jBAl6BHTNGiT9r2WdokXhtDGEF2/Hr4Oox7mcjBDq9MERb+G6iXPPQhPTL79a UhVrD4R9Yj9GV3P8iFt/pgdLoZ7tIO7LfRfsFnRJoVkavhUDh9gy3NFCc0qNTVhouIyYmZ56bDS0R IKv1jZOQ==; Received: from smtpout34.security-mail.net ([85.31.212.34]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t2sXP-00000007xWn-45ZD for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2024 13:33:37 +0000 Received: from localhost (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id C852F2A414B for ; Mon, 21 Oct 2024 15:33:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1729517588; bh=/ocSKZKP1X1oscswsJlqywTbmenaHDpKiNI1VPu/Qp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Omjxj7MlpOpYtYHF/CtwYtN6ApmbbScLxy2FFjfT4DQyTHAYPtTVTCcpLmbkSOZo0 AjlO/QaTaE7qzXEs71i9Xyuw2eClX8BXFfOV7YX0e4Jbz4Dvv4vTlDrpqcs8oBty8G SCNuS70cNmHVsI9hIY8YbF9XGJqOA6XU0TwBzvso= Received: from fx304 (localhost [127.0.0.1]) by fx304.security-mail.net (Postfix) with ESMTP id 8F6772A4580; Mon, 21 Oct 2024 15:33:08 +0200 (CEST) Received: from PR0P264CU014.outbound.protection.outlook.com (mail-francecentralazlp17012050.outbound.protection.outlook.com [40.93.76.50]) by fx304.security-mail.net (Postfix) with ESMTPS id E7A2A2A3BEA; Mon, 21 Oct 2024 15:33:07 +0200 (CEST) Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) by MR1P264MB2339.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:34::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29; Mon, 21 Oct 2024 13:33:06 +0000 Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626]) by PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626%3]) with mapi id 15.20.8069.027; Mon, 21 Oct 2024 13:33:06 +0000 X-Secumail-id: <106e4.67165813.e5c9e.0> ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iOEwvfpp4QNRW6gno77VwtnPc1kRrVfoUKXBbtcx3oSxzZw91WvEJhRk9ytKQd9byZx5ftZBhPiBYnVtjn27Yhnf040F7hdw4Pwt+n3Tg+YnnE3il/qKZ9EpMc4g/jbvqyzf6gbJeYk7IAED1rYtC2pXXGLAy7+MthQqgZtWegFsUqYLrBWq2xM7IPpT2S/j1RoXgfN7Ye+g+f4lIMbdkLIgIWzmqJuRPW8iofSqbR93fd2zTuEqPlaBxHoDoJsB03ogs9LHs3T0VwIELxjT3b3WM8F9x0GAXEoQqi/68Gc3m0SZ+scBtaVCupg/jFjGM3Wxo/yxbN06GH1Ei0zw+w== 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=k/Pgfr4aqWNaoWCaK9VM3FAG6Mrhm2a/4ETZWcrPJJs=; b=okkVWtDIhjrzPP/MXE9GnmqCzMR0tA1SpCOspsylsKHZHTK0+xYpzafYplbrz4XUdEc0VZpb9PuaAj5HmQcRd0CeOWfa42bqcv9+7ManuT7WOcp+YcAzLuJL/Itp/cOdRb+5s+Njm5UfKTivNKq3WsbO07AcN4iHCRGaB+ANToVtUknNMIYGqCYU1j5GKyUGPtayFxz1blR7xxnTzfLIHSceyxhZp6+Uld2bv8+IUsDpufMrKKQ/LGmzawa073iX8/tllbSlhcpku02aWPBKEGtn5DVDQlikKHY06ySPAExOq6WeTuGuocz1oM1VoSJof/rUPs9uS9l5JlK0omMIgw== 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=k/Pgfr4aqWNaoWCaK9VM3FAG6Mrhm2a/4ETZWcrPJJs=; b=L/J9OjrLY8hmAKFnRwd9IQIXt/O9SLNkfcmhJhF96apdywjybuDg6m4udCjGJRe8nMqFcGBWV4fFoRVVjI+T8gmIbkfCIpzzDwE2RVc92RTExsiXxcD3CWNHL7PpScuN+YqMqRXsY8uUR1wr+hr0edLeUbHpzm5+fTuXGra0hqY6K3q9wlu8dXGTFX7CoIbzRuarFQ1/q5pR1N4njETbLzhEQRKVLalloXD/NOLFcEe0eRxB/giWM7UBgkm1YmPPckqZDoy0hY87mMtxl6ebCSN9tABv+IGXfU71uvvLfptOW+eyWpSPkmxkxtRUEnAqhMRAUPLnhp1NQPFcv5ID4Q== 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 , Geert Uytterhoeven , Richard Henderson , Niklas Schnelle , Takashi Iwai , Miquel Raynal , David Laight , Johannes Berg , Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Yann Sionneau , Julian Vetter Subject: [PATCH v10 2/4] arm64: Use new fallback IO memcpy/memset Date: Mon, 21 Oct 2024 15:31:52 +0200 Message-ID: <20241021133154.516847-3-jvetter@kalrayinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021133154.516847-1-jvetter@kalrayinc.com> References: <20241021133154.516847-1-jvetter@kalrayinc.com> X-ClientProxiedBy: AS4P192CA0012.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5da::20) To PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAYP264MB3766:EE_|MR1P264MB2339:EE_ X-MS-Office365-Filtering-Correlation-Id: fc60c16d-29d3-412a-034e-08dcf1d4e59c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|7416014|376014|1800799024|921020|38350700014; X-Microsoft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ohncjcQ+NuLUBfg3u9pWNotNBl+sIMElWxAQAW5AkDGA1asuwa8niwpj0aMgS6lm+QitOEmCIYahDP8WoEDQEFA6GzYIGMVJ8XMAzTSj69Di5vmg0yIBvV0kjKL6D7bJXzyAhuY2xnlK459TBWS9mVQOOZAHPcPUKPFWAXIghX/i4Hxposvywtwyu9Zzz03A02UoPpSoClLypTUfRmC1nxcQdGjE7aBRfVYFR9TiHM2drmGyCz1lj2K/p1r1WuRuVDLOjEEM8CF3L+aEjt8I+jOwFQwr3U1sY16CzH0yub2wRRGux926cjZWF2qLt4oX4cZ/GBK6b8CoCkO6kyqEZGMe 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)(52116014)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kihkfdOx2VIAk8sd6cb64EACsa7B02KKJJI5DBhSQWcj5rDnOImgN0F/u7ZDariI+7AJa/xwgoME51qCJUDAuX/EsgV4qoHFnXwpSV9n3uh7GeNivH7jZk3lPbaU51rB96vr3owAlBj/M/G+Tba/5EHMIe8XO7Vvl39zFgvAHThEef7KhpdLGfom8TygzLiCx8/LfcFoDAY8Mzvp9GwvMjutSouVcqU7RckRthDlPsA9I3Ky2aF+wpNslnJbgS/6IbYp7HL84FvT2+3CpBZ/w/HJh0GucMedGWGakG7R0TcOzcsMsN7/7BuX4W9JxTKdWUuEMbOzfgmP1STANPdPsdhSl4A+MnSwcisUzhPFJM3mxvfTZJtcJ/c4t+o1GeND6pKOkKJc6nMcwtDJDQknqBQf/81dX6A5/LO+039QK6GHmANKln0Org51p/YTRrwJ16elK6bsAGGcMkQr28NdqFXBX43wzprQcbWA6EG5RfNeQR0Na5DGDcrGhMgWc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4B X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc60c16d-29d3-412a-034e-08dcf1d4e59c X-MS-Exchange-CrossTenant-AuthSource: PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 13:33:06.8276 (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: PnaTTzpXO2SCGPJxy8dnp5t4ejw6OX2zAQyKgRia29BmnLMnMhtUkjDrMZY6XkKitmJmV5j2GQ7NYJSiNS2aow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2339 X-ALTERMIMEV2_out: done X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_143336_177056_04D491D2 X-CRM114-Status: GOOD ( 15.15 ) 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 Use the new fallback memcpy_{from,to}io and memset_io functions from asm-generic/io.h on the arm64 processor architecture. Reviewed-by: Catalin Marinas Reviewed-by: Yann Sionneau Signed-off-by: Julian Vetter --- Changes for v10: - Slightly updated commit message to clarify that on arm64 we now use the fallback from asm-generic/io.h --- arch/arm64/include/asm/io.h | 11 ----- arch/arm64/kernel/io.c | 87 ------------------------------------- 2 files changed, 98 deletions(-) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 1ada23a6ec19..463067bffdfd 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -128,17 +128,6 @@ static __always_inline u64 __raw_readq(const volatile void __iomem *addr) #define IO_SPACE_LIMIT (PCI_IO_SIZE - 1) #define PCI_IOBASE ((void __iomem *)PCI_IO_START) -/* - * String version of I/O memory access operations. - */ -extern void __memcpy_fromio(void *, const volatile void __iomem *, size_t); -extern void __memcpy_toio(volatile void __iomem *, const void *, size_t); -extern void __memset_io(volatile void __iomem *, int, size_t); - -#define memset_io(c,v,l) __memset_io((c),(v),(l)) -#define memcpy_fromio(a,c,l) __memcpy_fromio((a),(c),(l)) -#define memcpy_toio(c,a,l) __memcpy_toio((c),(a),(l)) - /* * The ARM64 iowrite implementation is intended to support drivers that want to * use write combining. For instance PCI drivers using write combining with a 64 diff --git a/arch/arm64/kernel/io.c b/arch/arm64/kernel/io.c index ef48089fbfe1..fe86ada23c7d 100644 --- a/arch/arm64/kernel/io.c +++ b/arch/arm64/kernel/io.c @@ -9,34 +9,6 @@ #include #include -/* - * Copy data from IO memory space to "real" memory space. - */ -void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count) -{ - while (count && !IS_ALIGNED((unsigned long)from, 8)) { - *(u8 *)to = __raw_readb(from); - from++; - to++; - count--; - } - - while (count >= 8) { - *(u64 *)to = __raw_readq(from); - from += 8; - to += 8; - count -= 8; - } - - while (count) { - *(u8 *)to = __raw_readb(from); - from++; - to++; - count--; - } -} -EXPORT_SYMBOL(__memcpy_fromio); - /* * This generates a memcpy that works on a from/to address which is aligned to * bits. Count is in terms of the number of bits sized quantities to copy. It @@ -78,62 +50,3 @@ void __iowrite32_copy_full(void __iomem *to, const void *from, size_t count) dgh(); } EXPORT_SYMBOL(__iowrite32_copy_full); - -/* - * Copy data from "real" memory space to IO memory space. - */ -void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count) -{ - while (count && !IS_ALIGNED((unsigned long)to, 8)) { - __raw_writeb(*(u8 *)from, to); - from++; - to++; - count--; - } - - while (count >= 8) { - __raw_writeq(*(u64 *)from, to); - from += 8; - to += 8; - count -= 8; - } - - while (count) { - __raw_writeb(*(u8 *)from, to); - from++; - to++; - count--; - } -} -EXPORT_SYMBOL(__memcpy_toio); - -/* - * "memset" on IO memory space. - */ -void __memset_io(volatile void __iomem *dst, int c, size_t count) -{ - u64 qc = (u8)c; - - qc |= qc << 8; - qc |= qc << 16; - qc |= qc << 32; - - while (count && !IS_ALIGNED((unsigned long)dst, 8)) { - __raw_writeb(c, dst); - dst++; - count--; - } - - while (count >= 8) { - __raw_writeq(qc, dst); - dst += 8; - count -= 8; - } - - while (count) { - __raw_writeb(c, dst); - dst++; - count--; - } -} -EXPORT_SYMBOL(__memset_io);