From patchwork Tue Sep 12 06:22: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: 138659 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp884002vqx; Tue, 12 Sep 2023 23:18:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaGLOKOBIKP0y9Y5IUjxds4NsMV/ad7psTknLaYdQvHxf5dxslUqlitLcMvN/Mf6pAegS7 X-Received: by 2002:a05:6a21:78a5:b0:148:656b:9a1f with SMTP id bf37-20020a056a2178a500b00148656b9a1fmr1840914pzc.20.1694585936848; Tue, 12 Sep 2023 23:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694585936; cv=none; d=google.com; s=arc-20160816; b=cj827bgk2hTSXF0SUZL4L+6FUMZeB1FQ6PE5/kQPRRvM69rxPDenLk4JdGg8h8SQn5 AeyI/XBCkbRIkkYFws2CO6scZ86BOgf98/qY0cCKdem1vMPVaEjOWSOjFXRQAWXkezL2 vvDlUaZelbkLJ2pG88iwjCnzfhE1QjgwS92+d63vQK6VXK3h+tcz/JdjefIlhtM437jG b9yUuxjxQoEfj60JOJZvOm+/hEjQofzn/ZapklE/b5/StNdN/rkp09NLWZMwcwwz8PDo u1tFIgFf+CRLhPRL9yO/vICeC94G2XdZyp8iPGzN3f+MiPiX5U0UZRpUneBoAOqNF+Nk W7oQ== 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:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=zIKe3BGZAvYyd6OF2U38OylY1u4o8nivsPg6ghqA7go=; fh=ccr0CsJqqGN+DnmIHeP4NMRC67DFuwjoEdLtYhziS80=; b=KCkJvcXwz9jvdrgE+hmmrwvAho39sH5gAGn6dmkEhsprT+5Nn/D+v1aKldvN4c6DSP F4eNEo+xXjSqJpSSrOkX3ylOMdzi1va+HSkPYWvAj25eIVHrT8H2xIK3ZkfjTQTTA1Xk blGIr5y3IrW0UNbSLk+yx7FApTyBKnfR1mvhPQcXhZnQ7LoMQj16JyXoCO/PoePsVunW tJRUR9u66hX7c4F3hI0zzh4wbZH/dqHKihJgjnUTU/BIk2OHZIaWUABCuZz366sIZxzS e7cfxsJEaA+x9szDVQh3VNiRj7BCN/fj9R7rur/HXUn53o1MEb9M+3NsPYCt03vsOQuq QAMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wwZTh3Kd; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=3539uvpM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id oj10-20020a17090b4d8a00b0026b49dac834si998919pjb.34.2023.09.12.23.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 23:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wwZTh3Kd; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=3539uvpM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 5BB9882DAD3D; Mon, 11 Sep 2023 23:22:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbjILGWh (ORCPT + 39 others); Tue, 12 Sep 2023 02:22:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjILGWg (ORCPT ); Tue, 12 Sep 2023 02:22:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FA60AF; Mon, 11 Sep 2023 23:22:32 -0700 (PDT) Date: Tue, 12 Sep 2023 06:22:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694499750; 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: in-reply-to:in-reply-to:references:references; bh=zIKe3BGZAvYyd6OF2U38OylY1u4o8nivsPg6ghqA7go=; b=wwZTh3Kd7DOhT+nfic9ynlU3jnAuNf7c0W0mEDrN4uKEcWbKRrkKQj/PDAUdV5/JAcehSb CcstLCoh5lj93q6FjyckVnqeSTeJsYSaHLEUxofQnTM3DdUZjmBrr9QD6dx39xoRTJsTat 7A6YBHeXekcq+K4vzPpgECeAlBEVvnIsejh24xuOZ/5lvZphw89cl8ZBNeqTw8fGx0YT6a u+9fXADOc9zMqT1X4VghGN/cKQEkAGvEiz8/AwODfX/Ly3SZb7jPMpaSFM5lo/VYGY4we3 kdFYpZvK4WGomkdR0h8hNzFbO4/hJhx2/CBFXWRX6Vtmbicv3XiCR6d0mGZhmA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694499750; 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: in-reply-to:in-reply-to:references:references; bh=zIKe3BGZAvYyd6OF2U38OylY1u4o8nivsPg6ghqA7go=; b=3539uvpMEJOIkXB25Vmqmz78+g6XjsGzHwJrdWOtHu0fDN70yBXWJkDyB4oEIc7xefxE8n hndvcTXNlFQbhaAQ== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/urgent] objtool: Fix _THIS_IP_ detection for cold functions Cc: Josh Poimboeuf , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <169449974941.27769.5966361475129342374.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 (howler.vger.email [0.0.0.0]); Mon, 11 Sep 2023 23:22:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776819649401225519 X-GMAIL-MSGID: 1776902143361145532 The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 72178d5d1a38dd185d1db15f177f2d122ef10d9b Gitweb: https://git.kernel.org/tip/72178d5d1a38dd185d1db15f177f2d122ef10d9b Author: Josh Poimboeuf AuthorDate: Mon, 11 Sep 2023 16:56:13 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 12 Sep 2023 08:16:54 +02:00 objtool: Fix _THIS_IP_ detection for cold functions Cold functions and their non-cold counterparts can use _THIS_IP_ to reference each other. Don't warn about !ENDBR in that case. Note that for GCC this is currently irrelevant in light of the following commit c27cd083cfb9 ("Compiler attributes: GCC cold function alignment workarounds") which disabled cold functions in the kernel. However this may still be possible with Clang. Fixes several warnings like the following: drivers/scsi/bnx2i/bnx2i.prelink.o: warning: objtool: bnx2i_hw_ep_disconnect+0x19d: relocation to !ENDBR: bnx2i_hw_ep_disconnect.cold+0x0 drivers/net/ipvlan/ipvlan.prelink.o: warning: objtool: ipvlan_addr4_event.cold+0x28: relocation to !ENDBR: ipvlan_addr4_event+0xda drivers/net/ipvlan/ipvlan.prelink.o: warning: objtool: ipvlan_addr6_event.cold+0x26: relocation to !ENDBR: ipvlan_addr6_event+0xb7 drivers/net/ethernet/broadcom/tg3.prelink.o: warning: objtool: tg3_set_ringparam.cold+0x17: relocation to !ENDBR: tg3_set_ringparam+0x115 drivers/net/ethernet/broadcom/tg3.prelink.o: warning: objtool: tg3_self_test.cold+0x17: relocation to !ENDBR: tg3_self_test+0x2e1 drivers/target/iscsi/cxgbit/cxgbit.prelink.o: warning: objtool: __cxgbit_free_conn.cold+0x24: relocation to !ENDBR: __cxgbit_free_conn+0xfb net/can/can.prelink.o: warning: objtool: can_rx_unregister.cold+0x2c: relocation to !ENDBR: can_rx_unregister+0x11b drivers/net/ethernet/qlogic/qed/qed.prelink.o: warning: objtool: qed_spq_post+0xc0: relocation to !ENDBR: qed_spq_post.cold+0x9a drivers/net/ethernet/qlogic/qed/qed.prelink.o: warning: objtool: qed_iwarp_ll2_comp_syn_pkt.cold+0x12f: relocation to !ENDBR: qed_iwarp_ll2_comp_syn_pkt+0x34b net/tipc/tipc.prelink.o: warning: objtool: tipc_nametbl_publish.cold+0x21: relocation to !ENDBR: tipc_nametbl_publish+0xa6 Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/d8f1ab6a23a6105bc023c132b105f245c7976be6.1694476559.git.jpoimboe@kernel.org --- tools/objtool/check.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 1384090..e308d1b 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4333,7 +4333,8 @@ static int validate_ibt_insn(struct objtool_file *file, struct instruction *insn continue; } - if (insn_func(dest) && insn_func(dest) == insn_func(insn)) { + if (insn_func(dest) && insn_func(insn) && + insn_func(dest)->pfunc == insn_func(insn)->pfunc) { /* * Anything from->to self is either _THIS_IP_ or * IRET-to-self.