Skip to content

Commit 67bb8e9

Browse files
tlendackyIngo Molnar
authored andcommitted
x86/mm: Disable various instrumentations of mm/mem_encrypt.c and mm/tlb.c
Some routines in mem_encrypt.c are called very early in the boot process, e.g. sme_enable(). When CONFIG_KCOV=y is defined the resulting code added to sme_enable() (and others) for KCOV instrumentation results in a kernel crash. Disable the KCOV instrumentation for mem_encrypt.c by adding KCOV_INSTRUMENT_mem_encrypt.o := n to arch/x86/mm/Makefile. In order to avoid other possible early boot issues, model mem_encrypt.c after head64.c in regards to tools. In addition to disabling KCOV as stated above and a previous patch that disables branch profiling, also remove the "-pg" CFLAG if CONFIG_FUNCTION_TRACER is enabled and set KASAN_SANITIZE to "n", each of which are done on a file basis. Reported-by: kernel test robot <[email protected]> Signed-off-by: Tom Lendacky <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent ab7ff47 commit 67bb8e9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

arch/x86/mm/Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
# Kernel does not boot with instrumentation of tlb.c.
2-
KCOV_INSTRUMENT_tlb.o := n
1+
# Kernel does not boot with instrumentation of tlb.c and mem_encrypt.c
2+
KCOV_INSTRUMENT_tlb.o := n
3+
KCOV_INSTRUMENT_mem_encrypt.o := n
4+
5+
KASAN_SANITIZE_mem_encrypt.o := n
6+
7+
ifdef CONFIG_FUNCTION_TRACER
8+
CFLAGS_REMOVE_mem_encrypt.o = -pg
9+
endif
310

411
obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \
512
pat.o pgtable.o physaddr.o setup_nx.o tlb.o

0 commit comments

Comments
 (0)