From nobody Tue Jun 23 07:09:44 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06C8FC433F5 for ; Wed, 9 Mar 2022 07:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbiCIH6q (ORCPT ); Wed, 9 Mar 2022 02:58:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231182AbiCIH4q (ORCPT ); Wed, 9 Mar 2022 02:56:46 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D5216307A; Tue, 8 Mar 2022 23:55:17 -0800 (PST) Date: Wed, 09 Mar 2022 07:55:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1646812516; 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=TfzTGlcUujJvCl42SOtzUGnx4onyvN51b7YdmOYIQDw=; b=kCQtTlZx4u+FpYFBc17efhiQBEddqUBY5tKmoCJJ8rY4VsKR+d25zE+FOX+eksmDrpCJ/o QPsRPAZdcddd3YVKY4kfhw5aheUuenTfy8btatOTRJEsPQU73rN8GWUiXv6BXmQJduOQVh rvPYMdr/0I7z5el16wFzg/HIX4jPQP7fRywZAmpRJKqGQP6qXVHP0nShmVRsJMBGyL4irP 03yMXZHcaqVTFVEcyUKYCgr+DfyhnX1Atc7mlypr5A3ujn4Y4Kt2oVy/qJ5MMgcbbixhFK ialgBl3L8kZxwglGUNYm2texBl3jdteHuH9lFSmDumr9ZyNTHYRx/NLkeiptRQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1646812516; 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=TfzTGlcUujJvCl42SOtzUGnx4onyvN51b7YdmOYIQDw=; b=WffJGLd1smQzuyNsQszPsRL1116+a98xJpCUBMbeZUoqEzaqBQiS1J3cJ39r1fkJ2TbxNP mq4BSAO/4u71qMCA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] objtool: Default ignore INT3 for unreachable Cc: "Peter Zijlstra (Intel)" , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220308154317.343312938@infradead.org> References: <20220308154317.343312938@infradead.org> MIME-Version: 1.0 Message-ID: <164681251517.16921.3649961493777847480.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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/core branch of tip: Commit-ID: def466688a10fe8a2e1da7d3a72b4a29ff6b1a9e Gitweb: https://git.kernel.org/tip/def466688a10fe8a2e1da7d3a72b4a29f= f6b1a9e Author: Peter Zijlstra AuthorDate: Tue, 08 Mar 2022 16:30:14 +01:00 Committer: Peter Zijlstra CommitterDate: Tue, 08 Mar 2022 23:53:27 +01:00 objtool: Default ignore INT3 for unreachable Ignore all INT3 instructions for unreachable code warnings, similar to NOP. This allows using INT3 for various paddings instead of NOPs. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.343312938@infradead.org --- tools/objtool/check.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 7c33ec6..311bfc6 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3115,9 +3115,8 @@ static int validate_branch(struct objtool_file *file,= struct symbol *func, switch (insn->type) { =20 case INSN_RETURN: - if (next_insn && next_insn->type =3D=3D INSN_TRAP) { - next_insn->ignore =3D true; - } else if (sls && !insn->retpoline_safe) { + if (sls && !insn->retpoline_safe && + next_insn && next_insn->type !=3D INSN_TRAP) { WARN_FUNC("missing int3 after ret", insn->sec, insn->offset); } @@ -3164,9 +3163,8 @@ static int validate_branch(struct objtool_file *file,= struct symbol *func, break; =20 case INSN_JUMP_DYNAMIC: - if (next_insn && next_insn->type =3D=3D INSN_TRAP) { - next_insn->ignore =3D true; - } else if (sls && !insn->retpoline_safe) { + if (sls && !insn->retpoline_safe && + next_insn && next_insn->type !=3D INSN_TRAP) { WARN_FUNC("missing int3 after indirect jump", insn->sec, insn->offset); } @@ -3337,7 +3335,7 @@ static bool ignore_unreachable_insn(struct objtool_fi= le *file, struct instructio int i; struct instruction *prev_insn; =20 - if (insn->ignore || insn->type =3D=3D INSN_NOP) + if (insn->ignore || insn->type =3D=3D INSN_NOP || insn->type =3D=3D INSN_= TRAP) return true; =20 /*