From patchwork Wed Feb 21 01:17:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 13564830 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 65016C48BC4 for ; Wed, 21 Feb 2024 01:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=qNu11H2vAcjZwxXYtahWXxucEChQm9jgLnAn+92Y81Y=; b=rtN3yrWiZgFnqq UGIW8GAl1Q8LOsrrEfL9LL0b/PM56rVgfRPgXUZ+UGMpXsh+/Y380NMzdUeqGjiW67GieGPHf3qvz EVuHlab33WSX0H2toH5iM2H8eP0mauMmHFX96dt3tD3YTOPVBGzkYOV4sPTWRTt2SzpiNu4HF1KwN CYNP5LjO/TqDIEPAMD96Q2q9jLkAkQKtDnRiqkBK4HLYPME5dhH7ryiPSP7v0olAfTJKUi9soc6FV A4gTIZjBe+9FIau8RFvv4GnaW4yG1eWWU4ncxmFRWHhRHSdX3583q7wvF8zVC5VPqKdWRUf5XHgWq OLYzeKcX9rCXhR0nyOzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcbEy-0000000GilF-47Hs; Wed, 21 Feb 2024 01:17:40 +0000 Received: from mail-mw2nam10on20601.outbound.protection.outlook.com ([2a01:111:f403:2412::601] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcbEk-0000000GidV-06Al for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 01:17:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IF9YtUOOKUKaj+suKxk3wzvlTWIk+QK3nt/dOeBhws7A8o4Ixi9023GzMR9y4pMz3aBi5Ep8bKi3Ej7wIKA3CP1Ct1B8TCYwx1U5KbQU89xy8Lv6PaYisbTSalP8z40lZVoWMQjGJPKypH6fyrUgBfJX+ely8qCc2JOu0oRL4DnvWXgqbFvh5p5gu9Dum84NTP11b5Ka2YNOe21HtKfisBLPO7OT8naBClkLcRErTASF6IpUQDxe3iqv9HdXvTCrCDiv8tRp03SqHagc+Z2O3U9eFFP4gPPrurgr994O8I/oy/8tqmf1yE+kIW5a6qYTr/PqYBfL5EMl8qUMEcbdIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=A8AAjccZiDocpI+iUhnHuPYfPmCAn0tQ1el49HyzkKg=; b=BKbI5vgc3+vYcBLDfBxIeGVXiN5mrbXgFQZLE87wFRDhf79dYMNpKc85V+bssSifzpSduYe3uQD0s4X+EbywMY2Nx0Xq/UhqL18RnZgXDDvRPh0Yu8LzdwPD7EC2HP0sjw8oWqZ3kEJsqe+9s1lSXp12yRWzrN7Z/zMgqVxMxlUJvO0XjBHQFTM3J7WnIVDE8lutrpAt0GjV4JWHnsajLy1Dt/Ntq/Iog4xp+Gr4W/Xs8MPBxYdekvgI0TaEBt4hkEcaSLmRoQqOV2b8gGyEbBms5Wjlv4onIum/3zGw+yzp6dhhoUoS/C7wsOwK/wmvxp56XhZE4PJLKcL9a8MV7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A8AAjccZiDocpI+iUhnHuPYfPmCAn0tQ1el49HyzkKg=; b=DTuRs4RuO3kRZ7VQ0o+K6SVfOREsUKEVc3nii+UbQr4jgMr33fcd01Kj9cpgXPeKADtt3rox1POh9L9U0EitZ5eIL+1TwLM1BFbqyUp8P6T8IhXTd9FHzvMREt+5NEnZG6FaMLBk22TlESRHOOlMWMhNfHwGZmWAyyuDpRXU9eWOLo+o8DoJCcdzhmRC4WnJVKhloUCh6nLv3EyNVxQdHEqy/2ShAWncGr7tRBnIBwLl0rOhQPwqTJYdRpDPddAUUoyNAokPO/3eeiPJ0IBYGgdhvPPRmOhwT6d8z6lTRQ8DNebEHq1Elx/sevt6Ijx8viW/coWljBdA6otgjuglFg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by MN0PR12MB5714.namprd12.prod.outlook.com (2603:10b6:208:371::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.19; Wed, 21 Feb 2024 01:17:13 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::96dd:1160:6472:9873%6]) with mapi id 15.20.7316.018; Wed, 21 Feb 2024 01:17:13 +0000 From: Jason Gunthorpe To: Alexander Gordeev , Andrew Morton , Christian Borntraeger , Borislav Petkov , Dave Hansen , "David S. Miller" , Eric Dumazet , Gerald Schaefer , Vasily Gorbik , Heiko Carstens , "H. Peter Anvin" , Justin Stitt , Jakub Kicinski , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, llvm@lists.linux.dev, Ingo Molnar , Bill Wendling , Nathan Chancellor , Nick Desaulniers , netdev@vger.kernel.org, Paolo Abeni , Salil Mehta , Jijie Shao , Sven Schnelle , Thomas Gleixner , x86@kernel.org, Yisen Zhuang Cc: Arnd Bergmann , Catalin Marinas , Leon Romanovsky , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Rutland , Michael Guralnik , patches@lists.linux.dev, Niklas Schnelle , Will Deacon Subject: [PATCH 3/6] s390: Stop using weak symbols for __iowrite64_copy() Date: Tue, 20 Feb 2024 21:17:07 -0400 Message-ID: <3-v1-38290193eace+5-mlx5_arm_wc_jgg@nvidia.com> In-Reply-To: <0-v1-38290193eace+5-mlx5_arm_wc_jgg@nvidia.com> References: X-ClientProxiedBy: MN2PR01CA0065.prod.exchangelabs.com (2603:10b6:208:23f::34) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|MN0PR12MB5714:EE_ X-MS-Office365-Filtering-Correlation-Id: e4e41e24-5250-43a7-18e4-08dc327ad4c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2obyQZaplIdlx9P1Oz/M8pb2d/0l3SYhM14cNXw+bZRp5q94u9zpGeU7u3PR+UWuEk26Q5VRDB11o5FmCtHAPiws4tcCzvd0QnS3ZM5YyGFnXL3yEvRVOmwhKoRm2NPch1ckyWWAtdQ63DdUllPaORwkAJM/70Yeg07wys+bPmFQups9tMp+8aR4DG78dsOG5pzECeNym8WbFt2I8cqzxgnmzwP6jmRyoHhQm4VYebGER/8mYY7Qn/Y2d9BtR3QuSmDBz81e3vmp7U5C7JYlbODqLU9jM+nkppY9x18vH9ujil48MEDhFuQxnrGUnckElNP+hEcIHmumfcTu3ejz8tT4GX44eZ6LAThp5blMiTnFNqOL7MOVF3syWmaSJJJmwssnLDbrltJ4YERoZVHk2sN6M6d+3+38g7r8B9hSDuzlSK5XtaVRM60eXNfK/tmP+5S5rQ01wubPi8x8TWJDbY+EAEqnUwCtCCdE4yBlihRLsF9vow43GCQ7Ic+75MRbPZ7higvmnRYOcDoKEtoqNI5410ANO9cOoBgIOuemES7H/FNDTEq92iHVfLBOuu8si9mroc1B6M9I74yX1U2jhxsLfL7l1LgZYZsSp6SIAII= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6QCh+3B4LZsdWASkKEXEQAaJ0ED+UcF0U4GCBjOfLcLx75/9jnIUF2ARb33Hf6yeWP712AEZ8hFTu3iRTtyo6dD29WsVaU+QJzmRno9eY1M/Vg/669LNtwbCZuOIu6SpJkwR328H9X3H9uG6FhGqzui/ipU3JTej7VWHrA50niCyMr5GTVKeKH6NX/OBYw67lydZnnWUa655l53PkuuOiy+GqpkDEL0GMwFCQf8jUPVxgmy4zAEdFSa4hct9d9VTwjxSy97xHxyc/ydfRMOgqcHh7dsuxdg3A0+YOsyMSPA7R4FrWp7QTj7Gq2eszmEb048NSQl1EI4iDQ79P9w5G9R8cqFIhK6PbmHBaaPO5/1tt/1jGXLgIrq/60tHS0ecyf4eUfQLVMUAuEMilUSbkSXzj9YvSK+1cidBkgxPnRR3oY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CDnQ1RX1FIc0NCIJJiRgXn2gmf+qIIFY5KtTNm0wHSkyXCXxdzFnGT6wXrTmYANYJlqpCQfbquB1Usoj X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4e41e24-5250-43a7-18e4-08dc327ad4c7 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2024 01:17:11.8126 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yL3XbDf/mk345/2Zj4GGpRePm34LGu0jbT17qVuDzUMY4Q4pVgiTWc5QL9hYMB6T X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5714 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240220_171726_139522_A976C3FB X-CRM114-Status: GOOD ( 11.78 ) 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 Complete switching the __iowriteXX_copy() routines over to use #define and arch provided inline/macro functions instead of weak symbols. S390 has an implementation that simply calls another memcpy function. Inline this so the callers don't have to do two jumps. Acked-by: Niklas Schnelle Signed-off-by: Jason Gunthorpe --- arch/s390/include/asm/io.h | 7 +++++++ arch/s390/pci/pci.c | 6 ------ include/linux/io.h | 3 +++ lib/iomap_copy.c | 7 +++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h index 00704fc8a54b30..0fbc992d7a5ea7 100644 --- a/arch/s390/include/asm/io.h +++ b/arch/s390/include/asm/io.h @@ -81,6 +81,13 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from, } #define __iowrite32_copy __iowrite32_copy +static inline void __iowrite64_copy(void __iomem *to, const void *from, + size_t count) +{ + zpci_memcpy_toio(to, from, count * 8); +} +#define __iowrite64_copy __iowrite64_copy + #endif /* CONFIG_PCI */ #include diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 52a44e353796c0..fb81337a73eaab 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -249,12 +249,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, return 0; } -/* combine single writes by using store-block insn */ -void __iowrite64_copy(void __iomem *to, const void *from, size_t count) -{ - zpci_memcpy_toio(to, from, count * 8); -} - void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, unsigned long prot) { diff --git a/include/linux/io.h b/include/linux/io.h index 68cd551b6af112..fe12be9de6f7a6 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -21,7 +21,10 @@ void __iowrite32_copy(void __iomem *to, const void *from, size_t count); #endif void __ioread32_copy(void *to, const void __iomem *from, size_t count); + +#ifndef __iowrite64_copy void __iowrite64_copy(void __iomem *to, const void *from, size_t count); +#endif #ifdef CONFIG_MMU int ioremap_page_range(unsigned long addr, unsigned long end, diff --git a/lib/iomap_copy.c b/lib/iomap_copy.c index 8ddcbb53507dfe..2fd5712fb7c02b 100644 --- a/lib/iomap_copy.c +++ b/lib/iomap_copy.c @@ -60,9 +60,8 @@ EXPORT_SYMBOL_GPL(__ioread32_copy); * time. Order of access is not guaranteed, nor is a memory barrier * performed afterwards. */ -void __attribute__((weak)) __iowrite64_copy(void __iomem *to, - const void *from, - size_t count) +#ifndef __iowrite64_copy +void __iowrite64_copy(void __iomem *to, const void *from, size_t count) { #ifdef CONFIG_64BIT u64 __iomem *dst = to; @@ -75,5 +74,5 @@ void __attribute__((weak)) __iowrite64_copy(void __iomem *to, __iowrite32_copy(to, from, count * 2); #endif } - EXPORT_SYMBOL_GPL(__iowrite64_copy); +#endif