diff mbox series

[v4,16/30] x86/speculation/mds: Mark mds_idle_clear key as allowed in .noinstr

Message ID 20250114175143.81438-17-vschneid@redhat.com (mailing list archive)
State Handled Elsewhere
Headers show
Series context_tracking,x86: Defer some IPIs until a user->kernel transition | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR fail PR summary
conchuod/patch-16-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 139.60s
conchuod/patch-16-test-2 fail .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1008.02s
conchuod/patch-16-test-3 fail .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1233.03s
conchuod/patch-16-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 21.07s
conchuod/patch-16-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 23.39s
conchuod/patch-16-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.48s
conchuod/patch-16-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 42.73s
conchuod/patch-16-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.01s
conchuod/patch-16-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.55s
conchuod/patch-16-test-10 success .github/scripts/patches/tests/module_param.sh took 0.02s
conchuod/patch-16-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-16-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.04s

Commit Message

Valentin Schneider Jan. 14, 2025, 5:51 p.m. UTC
Later commits will cause objtool to warn about static keys being used in
.noinstr sections in order to safely defer instruction patching IPIs
targeted at NOHZ_FULL CPUs.

mds_idle_clear is used in .noinstr code, and can be modified at
runtime (SMT hotplug). Suppressing the text_poke_sync() IPI has little
benefits for this key, as hotplug implies eventually going through
takedown_cpu() -> stop_machine_cpuslocked() which is going to cause
interference on all online CPUs anyway.

Mark it to let objtool know not to warn about it.

Signed-off-by: Valentin Schneider <vschneid@redhat.com>
---
 arch/x86/kernel/cpu/bugs.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 47a01d4028f60..acad84dcfc3cd 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -113,8 +113,13 @@  DEFINE_STATIC_KEY_FALSE(switch_mm_cond_ibpb);
 /* Control unconditional IBPB in switch_mm() */
 DEFINE_STATIC_KEY_FALSE(switch_mm_always_ibpb);
 
-/* Control MDS CPU buffer clear before idling (halt, mwait) */
-DEFINE_STATIC_KEY_FALSE(mds_idle_clear);
+/*
+ * Control MDS CPU buffer clear before idling (halt, mwait)
+ *
+ * Allowed in .noinstr as this key is updated during hotplug which comes with
+ * more interference than just the text patching IPI.
+ */
+DEFINE_STATIC_KEY_FALSE_NOINSTR(mds_idle_clear);
 EXPORT_SYMBOL_GPL(mds_idle_clear);
 
 /*