linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Naohiro Aota <Naohiro.Aota@wdc.com>
To: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>
Subject: Re: [PATCH] x86/mm: disable instrumentations of mm/pgprot.c
Date: Wed, 31 Aug 2022 00:25:20 +0000	[thread overview]
Message-ID: <20220831002520.czdegytklq7xudnr@naota-xeon> (raw)
In-Reply-To: <20220824084726.2174758-1-naohiro.aota@wdc.com>

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.

  reply	other threads:[~2022-08-31  0:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-24  8:47 Naohiro Aota
2022-08-31  0:25 ` Naohiro Aota [this message]
2022-09-21  8:59 ` Niklas Cassel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220831002520.czdegytklq7xudnr@naota-xeon \
    --to=naohiro.aota@wdc.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox