Skip to content

Commit aef0148

Browse files
nivedita76Ingo Molnar
authored andcommitted
x86/cmdline: Disable jump tables for cmdline.c
When CONFIG_RETPOLINE is disabled, Clang uses a jump table for the switch statement in cmdline_find_option (jump tables are disabled when CONFIG_RETPOLINE is enabled). This function is called very early in boot from sme_enable() if CONFIG_AMD_MEM_ENCRYPT is enabled. At this time, the kernel is still executing out of the identity mapping, but the jump table will contain virtual addresses. Fix this by disabling jump tables for cmdline.c when AMD_MEM_ENCRYPT is enabled. Signed-off-by: Arvind Sankar <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fc3abb5 commit aef0148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ifdef CONFIG_FUNCTION_TRACER
2424
CFLAGS_REMOVE_cmdline.o = -pg
2525
endif
2626

27-
CFLAGS_cmdline.o := -fno-stack-protector
27+
CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables
2828
endif
2929

3030
inat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk

0 commit comments

Comments
 (0)