[tip: x86/alternatives] x86/alternatives: Add comment about noinstr expectations
From: tip-bot2 for Ingo Molnar
Date: Fri Apr 11 2025 - 06:03:44 EST
The following commit has been merged into the x86/alternatives branch of tip:
Commit-ID: 4f9534719e524affb1aa8e0ff0c8b30c1c65e574
Gitweb: https://git.kernel.org/tip/4f9534719e524affb1aa8e0ff0c8b30c1c65e574
Author: Ingo Molnar <mingo@xxxxxxxxxx>
AuthorDate: Fri, 11 Apr 2025 07:41:04 +02:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 11 Apr 2025 11:01:35 +02:00
x86/alternatives: Add comment about noinstr expectations
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Juergen Gross <jgross@xxxxxxxx>
Cc: "H . Peter Anvin" <hpa@xxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/20250411054105.2341982-53-mingo@xxxxxxxxxx
---
arch/x86/kernel/alternative.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 231b2ac..604dd60 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -2447,6 +2447,11 @@ static struct smp_text_poke_array {
static DEFINE_PER_CPU(atomic_t, text_poke_array_refs);
+/*
+ * These four __always_inline annotations imply noinstr, necessary
+ * due to smp_text_poke_int3_handler() being noinstr:
+ */
+
static __always_inline bool try_get_text_poke_array(void)
{
atomic_t *refs = this_cpu_ptr(&text_poke_array_refs);