Commit 0911b8c5 authored by Breno Leitao's avatar Breno Leitao Committed by Ingo Molnar
Browse files

x86/bugs: Rename CONFIG_RETHUNK => CONFIG_MITIGATION_RETHUNK



Step 10/10 of the namespace unification of CPU mitigations related Kconfig options.

[ mingo: Added one more case. ]

Suggested-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20231121160740.1249350-11-leitao@debian.org
parent a033eec9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2462,7 +2462,7 @@ config FINEIBT

config HAVE_CALL_THUNKS
	def_bool y
	depends on CC_HAS_ENTRY_PADDING && RETHUNK && OBJTOOL
	depends on CC_HAS_ENTRY_PADDING && MITIGATION_RETHUNK && OBJTOOL

config CALL_THUNKS
	def_bool n
@@ -2505,7 +2505,7 @@ config MITIGATION_RETPOLINE
	  branches. Requires a compiler with -mindirect-branch=thunk-extern
	  support for full protection. The kernel may run slower.

config RETHUNK
config MITIGATION_RETHUNK
	bool "Enable return-thunks"
	depends on MITIGATION_RETPOLINE && CC_HAS_RETURN_THUNK
	select OBJTOOL if HAVE_OBJTOOL
@@ -2518,7 +2518,7 @@ config RETHUNK

config MITIGATION_UNRET_ENTRY
	bool "Enable UNRET on kernel entry"
	depends on CPU_SUP_AMD && RETHUNK && X86_64
	depends on CPU_SUP_AMD && MITIGATION_RETHUNK && X86_64
	default y
	help
	  Compile the kernel with support for the retbleed=unret mitigation.
@@ -2572,7 +2572,7 @@ config MITIGATION_IBRS_ENTRY

config MITIGATION_SRSO
	bool "Mitigate speculative RAS overflow on AMD"
	depends on CPU_SUP_AMD && X86_64 && RETHUNK
	depends on CPU_SUP_AMD && X86_64 && MITIGATION_RETHUNK
	default y
	help
	  Enable the SRSO mitigation needed on AMD Zen1-4 machines.
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ RETPOLINE_VDSO_CFLAGS := -mretpoline
endif
RETPOLINE_CFLAGS	+= $(call cc-option,-mindirect-branch-cs-prefix)

ifdef CONFIG_RETHUNK
ifdef CONFIG_MITIGATION_RETHUNK
RETHUNK_CFLAGS		:= -mfunction-return=thunk-extern
RETPOLINE_CFLAGS	+= $(RETHUNK_CFLAGS)
endif
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ CONFIG_EFI_STUB=y
CONFIG_HZ_1000=y
CONFIG_KEXEC=y
CONFIG_CRASH_DUMP=y
# CONFIG_RETHUNK is not set
# CONFIG_MITIGATION_RETHUNK is not set
CONFIG_HIBERNATION=y
CONFIG_PM_DEBUG=y
CONFIG_PM_TRACE_RTC=y
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@
				 (1 << (X86_FEATURE_RETPOLINE_LFENCE & 31)))
#endif

#ifdef CONFIG_RETHUNK
#ifdef CONFIG_MITIGATION_RETHUNK
# define DISABLE_RETHUNK	0
#else
# define DISABLE_RETHUNK	(1 << (X86_FEATURE_RETHUNK & 31))
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@

#ifdef __ASSEMBLY__

#if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
#if defined(CONFIG_MITIGATION_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
#define RET	jmp __x86_return_thunk
#else /* CONFIG_MITIGATION_RETPOLINE */
#ifdef CONFIG_MITIGATION_SLS
@@ -52,7 +52,7 @@

#else /* __ASSEMBLY__ */

#if defined(CONFIG_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
#if defined(CONFIG_MITIGATION_RETHUNK) && !defined(__DISABLE_EXPORTS) && !defined(BUILD_VDSO)
#define ASM_RET	"jmp __x86_return_thunk\n\t"
#else /* CONFIG_MITIGATION_RETPOLINE */
#ifdef CONFIG_MITIGATION_SLS
Loading