]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Add a conditional CS prefix to CALL_NOSPEC
authorPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Sat, 1 Mar 2025 02:35:58 +0000 (18:35 -0800)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Mar 2025 10:14:42 +0000 (11:14 +0100)
commit052040e34c08428a5a388b85787e8531970c0c67
treea7fa9dd106815f80cb07ee03df50121bdcf45675
parentcfceff8526a426948b53445c02bcb98453c7330d
x86/speculation: Add a conditional CS prefix to CALL_NOSPEC

Retpoline mitigation for spectre-v2 uses thunks for indirect branches. To
support this mitigation compilers add a CS prefix with
-mindirect-branch-cs-prefix. For an indirect branch in asm, this needs to
be added manually.

CS prefix is already being added to indirect branches in asm files, but not
in inline asm. Add CS prefix to CALL_NOSPEC for inline asm as well. There
is no JMP_NOSPEC for inline asm.

Reported-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250228-call-nospec-v3-2-96599fed0f33@linux.intel.com
arch/x86/include/asm/nospec-branch.h