diff options
author | Arvind Sankar <nivedita@alum.mit.edu> | 2020-09-03 05:30:56 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-09-03 11:59:16 +0300 |
commit | aef0148f3606117352053c015cb33734e9ee7397 (patch) | |
tree | e25c5b211926c9a1470e1a8fb2f8b8a497f9b60c /arch | |
parent | fc3abb53250a90ba2150eebd182137c136f4d25a (diff) | |
download | linux-aef0148f3606117352053c015cb33734e9ee7397.tar.xz |
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 <nivedita@alum.mit.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200903023056.3914690-1-nivedita@alum.mit.edu
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/lib/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index d46fff11f06f..aa067859a70b 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -24,7 +24,7 @@ ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_cmdline.o = -pg endif -CFLAGS_cmdline.o := -fno-stack-protector +CFLAGS_cmdline.o := -fno-stack-protector -fno-jump-tables endif inat_tables_script = $(srctree)/arch/x86/tools/gen-insn-attr-x86.awk |