From nobody Sun May 10 22:40:28 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 02704C433EF for ; Fri, 22 Apr 2022 10:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446760AbiDVKje (ORCPT ); Fri, 22 Apr 2022 06:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1446692AbiDVKh4 (ORCPT ); Fri, 22 Apr 2022 06:37:56 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E66D9A; Fri, 22 Apr 2022 03:35:03 -0700 (PDT) Date: Fri, 22 Apr 2022 10:35:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1650623701; 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=wZHXcFr5/CUU4yWIdcKqkzcwAp9aFKWYg4vnUWc45rU=; b=oHsSCKqrJlZoHfjM4VUFHAp0sKJfittXC3nEBZ3T6sjoBHyTuxhuCNLI3qyaj42y4F7JHd zrVwu6zB1VnaBwTg34OxOILUzA4ej/eRzH5GJAlj7RSV48oSIpQ06B99NudLpXWRvuAZ01 isevSjPoIVZ+qx6P3i/oRuSh7tpnkKPMdVKgelXKHtVfDK5OLXzZ58Tuzj2GIgdRME+RIz 7K2U9ZAZyl/BLvVohbKbkCTszUboMZBcsYqpy0k7xsUGUO1u/sThLwBkDkJzdSqB6MIREQ VSQJtFz73GL615H2mBXyjrX1LiLXotirvAWvuyn6JYSLDaFLQv9MACDxZR0U+g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1650623701; 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=wZHXcFr5/CUU4yWIdcKqkzcwAp9aFKWYg4vnUWc45rU=; b=h11dljiruMatRwUj41GcEOs3O/942PUX75JY6F7n5U4dlgSVX6afri+BqsK7+hJOIYiMZV tDtRAq+Qkszjn/Aw== 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/core] objtool: Make static call annotation optional Cc: Josh Poimboeuf , "Peter Zijlstra (Intel)" , Miroslav Benes , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <165062370082.4207.775462247514219491.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 objtool/core branch of tip: Commit-ID: 26e176896a5bb9222ae3433da902edd2566a61a4 Gitweb: https://git.kernel.org/tip/26e176896a5bb9222ae3433da902edd25= 66a61a4 Author: Josh Poimboeuf AuthorDate: Mon, 18 Apr 2022 09:50:38 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 22 Apr 2022 12:32:03 +02:00 objtool: Make static call annotation optional As part of making objtool more modular, put the existing static call code behind a new '--static-call' option. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Miroslav Benes Link: https://lkml.kernel.org/r/d59ac57ef3d6d8380cdce20322314c9e2e556750.16= 50300597.git.jpoimboe@redhat.com --- scripts/Makefile.build | 1 + scripts/link-vmlinux.sh | 5 ++++- tools/objtool/builtin-check.c | 2 ++ tools/objtool/check.c | 10 ++++++---- tools/objtool/include/objtool/builtin.h | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 6eb99cb..3f20d56 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -233,6 +233,7 @@ objtool_args =3D \ $(if $(CONFIG_RETPOLINE), --retpoline) \ $(if $(CONFIG_SLS), --sls) \ $(if $(CONFIG_STACK_VALIDATION), --stackval) \ + $(if $(CONFIG_HAVE_STATIC_CALL_INLINE), --static-call) \ $(if $(CONFIG_X86_SMAP), --uaccess) \ $(if $(part-of-module), --module) \ $(if $(CONFIG_GCOV_KERNEL), --no-unreachable) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 1be0116..33f14fe 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -141,11 +141,14 @@ objtool_link() objtoolopt=3D"${objtoolopt} --stackval" fi =20 + if is_enabled CONFIG_HAVE_STATIC_CALL_INLINE; then + objtoolopt=3D"${objtoolopt} --static-call" + fi + if is_enabled CONFIG_X86_SMAP; then objtoolopt=3D"${objtoolopt} --uaccess" fi =20 - objtoolopt=3D"${objtoolopt} --lto" fi =20 diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 30971cc..c8c4d2b 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -40,6 +40,7 @@ const struct option check_options[] =3D { OPT_BOOLEAN('r', "retpoline", &opts.retpoline, "validate and annotate ret= poline usage"), OPT_BOOLEAN('l', "sls", &opts.sls, "validate straight-line-speculation mi= tigations"), OPT_BOOLEAN('s', "stackval", &opts.stackval, "validate frame pointer rule= s"), + OPT_BOOLEAN('t', "static-call", &opts.static_call, "annotate static calls= "), OPT_BOOLEAN('u', "uaccess", &opts.uaccess, "validate uaccess rules for SM= AP"), OPT_CALLBACK_OPTARG(0, "dump", NULL, NULL, "orc", "dump metadata", parse_= dump), =20 @@ -93,6 +94,7 @@ static bool opts_valid(void) opts.retpoline || opts.sls || opts.stackval || + opts.static_call || opts.uaccess) { if (opts.dump_orc) { fprintf(stderr, "--dump can't be combined with other options\n"); diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3e02126..b9ac351 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -3969,10 +3969,12 @@ int check(struct objtool_file *file) warnings +=3D ret; } =20 - ret =3D create_static_call_sections(file); - if (ret < 0) - goto out; - warnings +=3D ret; + if (opts.static_call) { + ret =3D create_static_call_sections(file); + if (ret < 0) + goto out; + warnings +=3D ret; + } =20 if (opts.retpoline) { ret =3D create_retpoline_sites_sections(file); diff --git a/tools/objtool/include/objtool/builtin.h b/tools/objtool/includ= e/objtool/builtin.h index 24a7ff4..dc47572 100644 --- a/tools/objtool/include/objtool/builtin.h +++ b/tools/objtool/include/objtool/builtin.h @@ -19,6 +19,7 @@ struct opts { bool retpoline; bool sls; bool stackval; + bool static_call; bool uaccess; =20 /* options: */