[PATCH 52/53] x86/alternatives: Add comment about noinstr expectations

From: Ingo Molnar
Date: Fri Apr 11 2025 - 01:51:10 EST


Signed-off-by: Ingo Molnar <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 231b2acbe360..604dd608d281 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);
--
2.45.2