Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3113818rdb; Wed, 13 Sep 2023 02:22:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2GqIRGe7boQ2toqeNE4FIF27+Q9Twe6xrLKPxcnRW+kES3b9fYf256y3HsxyEHH9bxGqj X-Received: by 2002:a17:90a:2dc2:b0:268:ca63:e412 with SMTP id q2-20020a17090a2dc200b00268ca63e412mr1501849pjm.4.1694596973489; Wed, 13 Sep 2023 02:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694596973; cv=none; d=google.com; s=arc-20160816; b=VVuK5ypeoOuUSGUdXtdGjWqOXAei72DTDxzhUN30WVAsNhmmmFj2PhNmjb3p12dbmq 4GjDJm9qiZd+TWfwTLMitN6Wgg060t7nrm7wnfiTnHRgAHRHBmT5HS727F1S0Fe9RmUF 86kB/984SZW78VPCTw1kjFDqlNZqxSKkzuy+xTn3iN6+jOVzyh+yf6NHIJVGASQi1Q34 QAOPgnOn0d6NwXtDcOD0nlPDVZ+geOZIV9lunj2KbUqzjKekTlCu05TVn82wVdr4Ec+J kojn+pNxs64Z1rv7OLkfL6XVP6u0wZGJ9EFOo50Clbr6cc6Xxor9ioXmzDVL+yg3VzoO DTyw== 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 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id o17-20020a17090a9f9100b00263ba5d7088si1133592pjp.48.2023.09.13.02.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 02:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; 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 23.128.96.34 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 F072D842E808; 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 S229886AbjILGWh (ORCPT + 99 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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:36 -0700 (PDT) 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.