Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/mm: disable instrumentations of mm/pgprot.c

Commit 4867fbbdd6b3 ("x86/mm: move protection_map[] inside the platform")
moved accesses to protection_map[] from mem_encrypt_amd.c to pgprot.c. As
a result, the accesses are now targets of KASAN (and other
instrumentations), leading to the crash during the boot process.

Disable the instrumentations for pgprot.c like commit 67bb8e999e0a
("x86/mm: Disable various instrumentations of mm/mem_encrypt.c and
mm/tlb.c").

Before this patch, my AMD machine cannot boot since v6.0-rc1 with KASAN
enabled, without anything printed. After the change, it successfully
boots up.

Fixes: 4867fbbdd6b3 ("x86/mm: move protection_map[] inside the platform")
Link: https://lkml.kernel.org/r/20220824084726.2174758-1-naohiro.aota@wdc.com
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Naohiro Aota and committed by
Andrew Morton
818c4fda ac87ca0e

+3
+3
arch/x86/mm/Makefile
··· 4 4 KCOV_INSTRUMENT_mem_encrypt.o := n 5 5 KCOV_INSTRUMENT_mem_encrypt_amd.o := n 6 6 KCOV_INSTRUMENT_mem_encrypt_identity.o := n 7 + KCOV_INSTRUMENT_pgprot.o := n 7 8 8 9 KASAN_SANITIZE_mem_encrypt.o := n 9 10 KASAN_SANITIZE_mem_encrypt_amd.o := n 10 11 KASAN_SANITIZE_mem_encrypt_identity.o := n 12 + KASAN_SANITIZE_pgprot.o := n 11 13 12 14 # Disable KCSAN entirely, because otherwise we get warnings that some functions 13 15 # reference __initdata sections. ··· 19 17 CFLAGS_REMOVE_mem_encrypt.o = -pg 20 18 CFLAGS_REMOVE_mem_encrypt_amd.o = -pg 21 19 CFLAGS_REMOVE_mem_encrypt_identity.o = -pg 20 + CFLAGS_REMOVE_pgprot.o = -pg 22 21 endif 23 22 24 23 obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o mmap.o \