Commit c0935fca authored by Changbin Du's avatar Changbin Du Committed by Borislav Petkov (AMD)

x86/sev: Disable KMSAN for memory encryption TUs

Instrumenting sev.c and mem_encrypt_identity.c with KMSAN will result in
a triple-faulting kernel. Some of the code is invoked too early during
boot, before KMSAN is ready.

Disable KMSAN instrumentation for the two translation units.

  [ bp: Massage commit message. ]
Signed-off-by: default avatarChangbin Du <changbin.du@huawei.com>
Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240308044401.1120395-1-changbin.du@huawei.com
parent d7b69b59
...@@ -33,6 +33,7 @@ KASAN_SANITIZE_sev.o := n ...@@ -33,6 +33,7 @@ KASAN_SANITIZE_sev.o := n
KCSAN_SANITIZE := n KCSAN_SANITIZE := n
KMSAN_SANITIZE_head$(BITS).o := n KMSAN_SANITIZE_head$(BITS).o := n
KMSAN_SANITIZE_nmi.o := n KMSAN_SANITIZE_nmi.o := n
KMSAN_SANITIZE_sev.o := n
# If instrumentation of the following files is enabled, boot hangs during # If instrumentation of the following files is enabled, boot hangs during
# first second. # first second.
......
...@@ -16,6 +16,7 @@ KASAN_SANITIZE_pgprot.o := n ...@@ -16,6 +16,7 @@ KASAN_SANITIZE_pgprot.o := n
KCSAN_SANITIZE := n KCSAN_SANITIZE := n
# Avoid recursion by not calling KMSAN hooks for CEA code. # Avoid recursion by not calling KMSAN hooks for CEA code.
KMSAN_SANITIZE_cpu_entry_area.o := n KMSAN_SANITIZE_cpu_entry_area.o := n
KMSAN_SANITIZE_mem_encrypt_identity.o := n
ifdef CONFIG_FUNCTION_TRACER ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_mem_encrypt.o = -pg CFLAGS_REMOVE_mem_encrypt.o = -pg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment