From patchwork Fri Sep 22 08:12:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 143519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5683480vqi; Fri, 22 Sep 2023 08:55:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzSNRAUUyjGozfCW5wbuIclbgHLrkSyWUS3BvU8SYtbVMxvLRQ9BM1LQGiolfc0AgLzPvE X-Received: by 2002:a17:90b:4f83:b0:263:f630:228f with SMTP id qe3-20020a17090b4f8300b00263f630228fmr109049pjb.23.1695398156996; Fri, 22 Sep 2023 08:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695398156; cv=none; d=google.com; s=arc-20160816; b=n4qiwLTcIAO69YuJ8997GA76Ldx8M6DgLl3Zdl/TywGQfmCPBkmo6JrG1xLxVUEHVD uW2AZAFrG58WzTyqFIrx/BbQ55TQUkZLNz0bau87fxZdSzpBkwkZXCGx7hIT+JChl6Ue fKNOPVsUM1Oan2KplaNlOSFlMpunCN3RWxyWTGmP1B2uOCLG46tLGuyGNTNhiJkxP0Yk tuGMiTKVEKuO9ydtPWirskEqawHChs9sMxGTqdUxL0vupEN90HbYyIcyrhEnlfVJfs7Z /NSi0X/IhO4P5FNeNVhOAdVMMTlhXIcT08dAfuXqeEXrmwYLtDmyS0WENs9dF3uscMRY 7sMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=ARBaVfzfcA6faFmUzH9kFAgDWK5n4gM0GoxjOTpPz6U=; fh=6Ar9X6qhu7f4c5U3K7vjvmGI0s8EmRGeawoYc01qZiY=; b=rIJCgrAD/lQYDhsQQ00nA9NKZVl6kgDRPKmZAUC/eN0/6ubGeIPEF2/4kEAyJ7LNt9 1wch6RVWFdTYTkEGCB5e6NhLDb+ewDHv62fO4HyFSAZn9tHGHiJbEcBTmNQN6503Eaoq gMxUyMFG3jhhcxEBRuSPiQIvmdwCWWmtX+w0xeE/Rj/AboUif6I4Ub5QncJMAVmmEXy4 w0ms3w3KO2rVCxY3GzjDo5F14sYgMiLFJf43nrLwgmEyYhmOCU/UYtWmmsdc2Pfb8Fek Djgu/NFNITyJpHey2wGMM6mZ2Rz0YAu0WCtDoues/UL7k5UPmAxoDCfA6yT3iatnLCkJ W0kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HvMCXmQz; dkim=neutral (no key) header.i=@linutronix.de header.b=fYWeBnxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d15-20020a17090a498f00b0027405eddd3fsi6273969pjh.19.2023.09.22.08.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 08:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HvMCXmQz; dkim=neutral (no key) header.i=@linutronix.de header.b=fYWeBnxO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D621683F69B9; Fri, 22 Sep 2023 01:13:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232549AbjIVINk (ORCPT + 30 others); Fri, 22 Sep 2023 04:13:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbjIVINJ (ORCPT ); Fri, 22 Sep 2023 04:13:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0452122; Fri, 22 Sep 2023 01:12:31 -0700 (PDT) Date: Fri, 22 Sep 2023 08:12:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695370350; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARBaVfzfcA6faFmUzH9kFAgDWK5n4gM0GoxjOTpPz6U=; b=HvMCXmQzLXKfmNWsJq5fVTrb4KFgTVRumB+bzpnHgDUP6z9edoFcwMEURMjxQL3B0beJil ptpeJ4tyu8hL+9ZPnsMcJQzEV/PLEz8Wk16sZWlMoSl7p3tGRROhdvSKnVh9n9muvHB7H7 M1fct/QaVbg6gdfe2sNYRdh6FfFe0zHs5S+2rwYw/eju9mvQu5bMyZzhcLAbHTpp7ET0cZ 6vFwLS5QVswAu8bWgMkbJDzL5Nx25YYgal5guFEJrsF0g59HjBi6tpUCoMu4YqgXgIGGMe 5aTo2YrEQQ1KtM+VJCPxyOmi6FOfttJqcsUpH0zi72dSvm+bPjQpr+RsnE6jgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695370350; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARBaVfzfcA6faFmUzH9kFAgDWK5n4gM0GoxjOTpPz6U=; b=fYWeBnxOWlXRTOYT5Qlux+8pPIU5HQwJB0Eo6VIdSeYTT+S2Lyfj/0niWSXwdgmfoSY61U R0BNto10t0+kkxAA== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/asm] x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32 Cc: Nathan Chancellor , Ingo Molnar , Linus Torvalds , linux-kernel@vger.kernel.org, x86@kernel.org MIME-Version: 1.0 Message-ID: <169537034995.27769.6683093223501252262.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:13:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777753818170577950 X-GMAIL-MSGID: 1777753818170577950 The following commit has been merged into the x86/asm branch of tip: Commit-ID: ad424743256b0119bd60a9248db4df5d998000a4 Gitweb: https://git.kernel.org/tip/ad424743256b0119bd60a9248db4df5d998000a4 Author: Ingo Molnar AuthorDate: Sat, 22 Jan 2022 13:39:15 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 22 Sep 2023 09:34:50 +02:00 x86/bitops: Remove unused __sw_hweight64() assembly implementation on x86-32 Header cleanups in the fast-headers tree highlighted that we have an unused assembly implementation for __sw_hweight64(): WARNING: modpost: EXPORT symbol "__sw_hweight64" [vmlinux] version ... __arch_hweight64() on x86-32 is defined in the arch/x86/include/asm/arch_hweight.h header as an inline, using __arch_hweight32(): #ifdef CONFIG_X86_32 static inline unsigned long __arch_hweight64(__u64 w) { return __arch_hweight32((u32)w) + __arch_hweight32((u32)(w >> 32)); } *But* there's also a __sw_hweight64() assembly implementation: arch/x86/lib/hweight.S SYM_FUNC_START(__sw_hweight64) #ifdef CONFIG_X86_64 ... #else /* CONFIG_X86_32 */ /* We're getting an u64 arg in (%eax,%edx): unsigned long hweight64(__u64 w) */ pushl %ecx call __sw_hweight32 movl %eax, %ecx # stash away result movl %edx, %eax # second part of input call __sw_hweight32 addl %ecx, %eax # result popl %ecx ret #endif But this __sw_hweight64 assembly implementation is unused - and it's essentially doing the same thing that the inline wrapper does. Remove the assembly version and add a comment about it. Reported-by: Nathan Chancellor Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org --- arch/x86/lib/hweight.S | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/arch/x86/lib/hweight.S b/arch/x86/lib/hweight.S index 12c16c6..0a152e5 100644 --- a/arch/x86/lib/hweight.S +++ b/arch/x86/lib/hweight.S @@ -36,8 +36,12 @@ SYM_FUNC_START(__sw_hweight32) SYM_FUNC_END(__sw_hweight32) EXPORT_SYMBOL(__sw_hweight32) -SYM_FUNC_START(__sw_hweight64) +/* + * No 32-bit variant, because it's implemented as an inline wrapper + * on top of __arch_hweight32(): + */ #ifdef CONFIG_X86_64 +SYM_FUNC_START(__sw_hweight64) pushq %rdi pushq %rdx @@ -66,18 +70,6 @@ SYM_FUNC_START(__sw_hweight64) popq %rdx popq %rdi RET -#else /* CONFIG_X86_32 */ - /* We're getting an u64 arg in (%eax,%edx): unsigned long hweight64(__u64 w) */ - pushl %ecx - - call __sw_hweight32 - movl %eax, %ecx # stash away result - movl %edx, %eax # second part of input - call __sw_hweight32 - addl %ecx, %eax # result - - popl %ecx - RET -#endif SYM_FUNC_END(__sw_hweight64) EXPORT_SYMBOL(__sw_hweight64) +#endif