]> git.baikalelectronics.ru Git - kernel.git/commit
x86/cmdline: Disable jump tables for cmdline.c
authorArvind Sankar <nivedita@alum.mit.edu>
Thu, 3 Sep 2020 02:30:56 +0000 (22:30 -0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 3 Sep 2020 08:59:16 +0000 (10:59 +0200)
commitcdd0a58bf6c50100c30ad17a1e2989fed0f17783
treee25c5b211926c9a1470e1a8fb2f8b8a497f9b60c
parentaa31d50368ee54218bb42fdb55c0674dd2dde707
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
arch/x86/lib/Makefile