* [PATCH] x86/mm: disable instrumentations of mm/pgprot.c
@ 2022-08-24 8:47 Naohiro Aota
2022-08-31 0:25 ` Naohiro Aota
2022-09-21 8:59 ` Niklas Cassel
0 siblings, 2 replies; 3+ messages in thread
From: Naohiro Aota @ 2022-08-24 8:47 UTC (permalink / raw)
To: linux-mm, akpm, x86
Cc: linux-kernel, Thomas Gleixner, Dave Hansen, Andy Lutomirski,
Peter Zijlstra, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
Naohiro Aota, Anshuman Khandual
The 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.
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
arch/x86/mm/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index f8220fd2c169..829c1409ffbd 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -4,10 +4,12 @@ KCOV_INSTRUMENT_tlb.o := n
KCOV_INSTRUMENT_mem_encrypt.o := n
KCOV_INSTRUMENT_mem_encrypt_amd.o := n
KCOV_INSTRUMENT_mem_encrypt_identity.o := n
+KCOV_INSTRUMENT_pgprot.o := n
KASAN_SANITIZE_mem_encrypt.o := n
KASAN_SANITIZE_mem_encrypt_amd.o := n
KASAN_SANITIZE_mem_encrypt_identity.o := n
+KASAN_SANITIZE_pgprot.o := n
# Disable KCSAN entirely, because otherwise we get warnings that some functions
# reference __initdata sections.
@@ -17,6 +19,7 @@ ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_mem_encrypt.o = -pg
CFLAGS_REMOVE_mem_encrypt_amd.o = -pg
CFLAGS_REMOVE_mem_encrypt_identity.o = -pg
+CFLAGS_REMOVE_pgprot.o = -pg
endif
obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o mmap.o \
--
2.37.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/mm: disable instrumentations of mm/pgprot.c
2022-08-24 8:47 [PATCH] x86/mm: disable instrumentations of mm/pgprot.c Naohiro Aota
@ 2022-08-31 0:25 ` Naohiro Aota
2022-09-21 8:59 ` Niklas Cassel
1 sibling, 0 replies; 3+ messages in thread
From: Naohiro Aota @ 2022-08-31 0:25 UTC (permalink / raw)
To: linux-mm, akpm, x86
Cc: linux-kernel, Thomas Gleixner, Dave Hansen, Andy Lutomirski,
Peter Zijlstra, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
Anshuman Khandual
On Wed, Aug 24, 2022 at 05:47:26PM +0900, Naohiro Aota wrote:
> The 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.
>
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
> arch/x86/mm/Makefile | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
> index f8220fd2c169..829c1409ffbd 100644
> --- a/arch/x86/mm/Makefile
> +++ b/arch/x86/mm/Makefile
> @@ -4,10 +4,12 @@ KCOV_INSTRUMENT_tlb.o := n
> KCOV_INSTRUMENT_mem_encrypt.o := n
> KCOV_INSTRUMENT_mem_encrypt_amd.o := n
> KCOV_INSTRUMENT_mem_encrypt_identity.o := n
> +KCOV_INSTRUMENT_pgprot.o := n
>
> KASAN_SANITIZE_mem_encrypt.o := n
> KASAN_SANITIZE_mem_encrypt_amd.o := n
> KASAN_SANITIZE_mem_encrypt_identity.o := n
> +KASAN_SANITIZE_pgprot.o := n
>
> # Disable KCSAN entirely, because otherwise we get warnings that some functions
> # reference __initdata sections.
> @@ -17,6 +19,7 @@ ifdef CONFIG_FUNCTION_TRACER
> CFLAGS_REMOVE_mem_encrypt.o = -pg
> CFLAGS_REMOVE_mem_encrypt_amd.o = -pg
> CFLAGS_REMOVE_mem_encrypt_identity.o = -pg
> +CFLAGS_REMOVE_pgprot.o = -pg
> endif
>
> obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o mmap.o \
> --
> 2.37.2
>
Hello, maintainers.
Gentle ping on this patch. I need this patch to boot up my AMD machine with
KASAN enabled.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/mm: disable instrumentations of mm/pgprot.c
2022-08-24 8:47 [PATCH] x86/mm: disable instrumentations of mm/pgprot.c Naohiro Aota
2022-08-31 0:25 ` Naohiro Aota
@ 2022-09-21 8:59 ` Niklas Cassel
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2022-09-21 8:59 UTC (permalink / raw)
To: akpm
Cc: linux-mm, x86, linux-kernel, Thomas Gleixner, Dave Hansen,
Andy Lutomirski, Peter Zijlstra, Ingo Molnar, Borislav Petkov,
H. Peter Anvin, Anshuman Khandual, Naohiro Aota
On Wed, Aug 24, 2022 at 05:47:26PM +0900, Naohiro Aota wrote:
> The 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.
>
> Cc: Anshuman Khandual <anshuman.khandual@arm.com>
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
Hello Andrew,
I see that this patch is in linux-next, but not in Linus's tree.
Since this fixes something introduced in v6.0-rc1, I think this
ought to go into v6.0 before it is released.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-21 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 8:47 [PATCH] x86/mm: disable instrumentations of mm/pgprot.c Naohiro Aota
2022-08-31 0:25 ` Naohiro Aota
2022-09-21 8:59 ` Niklas Cassel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.