From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: kernel test robot <lkp@intel.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/core] x86/ibt: Make cfi_bhi a constant for FINEIBT_BHI=n
Date: Mon, 03 Mar 2025 10:02:50 -0000 [thread overview]
Message-ID: <174099617138.10177.206551254938966948.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250303094911.GL5880@noisy.programming.kicks-ass.net>
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 73e8079be9e7ae5ed197d074e0ba6c43674c52f7
Gitweb: https://git.kernel.org/tip/73e8079be9e7ae5ed197d074e0ba6c43674c52f7
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Mon, 03 Mar 2025 10:21:47 +01:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Mon, 03 Mar 2025 10:54:11 +01:00
x86/ibt: Make cfi_bhi a constant for FINEIBT_BHI=n
Robot yielded a .config that tripped:
vmlinux.o: warning: objtool: do_jit+0x276: relocation to !ENDBR: .noinstr.text+0x6a60
This is the result of using __bhi_args[1] in unreachable code; make
sure the compiler is able to determine this is unreachable and trigger
DCE.
Closes: https://lore.kernel.org/oe-kbuild-all/202503030704.H9KFysNS-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250303094911.GL5880@noisy.programming.kicks-ass.net
---
arch/x86/include/asm/cfi.h | 5 +++++
arch/x86/kernel/alternative.c | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/arch/x86/include/asm/cfi.h b/arch/x86/include/asm/cfi.h
index 2f6a01f..3e51ba4 100644
--- a/arch/x86/include/asm/cfi.h
+++ b/arch/x86/include/asm/cfi.h
@@ -100,7 +100,12 @@ enum cfi_mode {
};
extern enum cfi_mode cfi_mode;
+
+#ifdef CONFIG_FINEIBT_BHI
extern bool cfi_bhi;
+#else
+#define cfi_bhi (0)
+#endif
typedef u8 bhi_thunk[32];
extern bhi_thunk __bhi_args[];
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 32e4b80..bf82c6f 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -936,7 +936,10 @@ void __init_or_module apply_seal_endbr(s32 *start, s32 *end) { }
#endif
enum cfi_mode cfi_mode __ro_after_init = __CFI_DEFAULT;
+
+#ifdef CONFIG_FINEIBT_BHI
bool cfi_bhi __ro_after_init = false;
+#endif
#ifdef CONFIG_CFI_CLANG
struct bpf_insn;
@@ -1070,11 +1073,15 @@ static __init int cfi_parse_cmdline(char *str)
pr_err("Ignoring paranoid; depends on fineibt.\n");
}
} else if (!strcmp(str, "bhi")) {
+#ifdef CONFIG_FINEIBT_BHI
if (cfi_mode == CFI_FINEIBT) {
cfi_bhi = true;
} else {
pr_err("Ignoring bhi; depends on fineibt.\n");
}
+#else
+ pr_err("Ignoring bhi; depends on FINEIBT_BHI=y.\n");
+#endif
} else {
pr_err("Ignoring unknown cfi option (%s).", str);
}
next prev parent reply other threads:[~2025-03-03 10:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-02 23:47 [tip:x86/core 16/17] vmlinux.o: warning: objtool: do_jit+0x276: relocation to !ENDBR: .noinstr.text+0x6a60 kernel test robot
2025-03-03 9:24 ` Peter Zijlstra
2025-03-03 9:43 ` Peter Zijlstra
2025-03-03 9:49 ` Peter Zijlstra
2025-03-03 10:02 ` tip-bot2 for Peter Zijlstra [this message]
2025-03-03 17:11 ` Kees Cook
2025-03-03 18:57 ` Peter Zijlstra
2025-03-03 19:09 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=174099617138.10177.206551254938966948.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=lkp@intel.com \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®