[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240308044401.1120395-1-changbin.du@huawei.com>
Date: Fri, 8 Mar 2024 12:44:01 +0800
From: Changbin Du <changbin.du@...wei.com>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
<x86@...nel.org>, Andy Lutomirski <luto@...nel.org>, Peter Zijlstra
<peterz@...radead.org>
CC: "H. Peter Anvin" <hpa@...or.com>, Alexander Potapenko <glider@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
<kasan-dev@...glegroups.com>, Changbin Du <changbin.du@...wei.com>
Subject: [PATCH] x86: kmsan: fix boot failure due to instrumentation
Instrumenting sev.c and mem_encrypt_identity.c with KMSAN will result in
kernel being unable to boot. Some of the code are invoked too early in
boot stage that before kmsan is ready.
This change disable kmsan instrumentation for above two files to fix the
boot failure.
Signed-off-by: Changbin Du <changbin.du@...wei.com>
---
arch/x86/kernel/Makefile | 1 +
arch/x86/mm/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 0000325ab98f..04591d0145e0 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -33,6 +33,7 @@ KASAN_SANITIZE_sev.o := n
KCSAN_SANITIZE := n
KMSAN_SANITIZE_head$(BITS).o := n
KMSAN_SANITIZE_nmi.o := n
+KMSAN_SANITIZE_sev.o := n
# If instrumentation of the following files is enabled, boot hangs during
# first second.
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index c80febc44cd2..6ec103bedcf1 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -16,6 +16,7 @@ KASAN_SANITIZE_pgprot.o := n
KCSAN_SANITIZE := n
# Avoid recursion by not calling KMSAN hooks for CEA code.
KMSAN_SANITIZE_cpu_entry_area.o := n
+KMSAN_SANITIZE_mem_encrypt_identity.o := n
ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_mem_encrypt.o = -pg
--
2.25.1
Powered by blists - more mailing lists