Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Abbott Liu <liuwenliang@huawei.com>,
	Russell King <linux@armlinux.org.uk>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Alexander Potapenko <glider@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 4/5 v10] ARM: Initialize the mapping of KASan shadow memory
Date: Tue, 30 Jun 2020 15:22:19 +0200
Message-ID: <CACRpkdZvQgPXBsdUO1JwBW0gE-Jhse0s8U0-Y5BGCcxkq_Ue2g@mail.gmail.com> (raw)
In-Reply-To: <20200615143316.GA28849@linux.ibm.com>

Hi Mike!

First a BIG THANKS for your help! With the aid of your review comments
and the further comments from Russell I have really progressed with this
patch set the last few days.

On Mon, Jun 15, 2020 at 4:33 PM Mike Rapoport <rppt@linux.ibm.com> wrote:

> > -#define pud_populate(mm,pmd,pte)     BUG()
> > -
> > +#ifndef CONFIG_KASAN
> > +#define pud_populate(mm, pmd, pte)   BUG()
> > +#else
> > +#define pud_populate(mm, pmd, pte)   do { } while (0)
>
> Hmm, is this really necessary? Regardless of CONFIG_KASAN pud_populate()
> should never be called for non-LPAE case...

It is necessary because the generic KASan code in
mm/kasan/init.c unconditionally calls pud_populate() and act as
if pud's always exist and need to be populated.

Possibly this means that pud_populate() should just be turned
into do { } while (0) as well (like other functions called unconditionally
from the VMM) but I'll leave this in for now.

>         cpu_switch_mm(tmp_pgd_table, &init_mm);
>
> And, why do we need a context switch here at all?

This is really just a way of reusing that function call to replace
the master page table pointer TTBR0 (Translation Table Base Register)
while setting up the shadow memory.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply index

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15  9:02 [PATCH 0/5 v10] KASan for Arm Linus Walleij
2020-06-15  9:02 ` [PATCH 1/5 v10] ARM: Disable KASan instrumentation for some code Linus Walleij
2020-06-15  9:02 ` [PATCH 2/5 v10] ARM: Replace string mem* functions for KASan Linus Walleij
2020-06-15  9:02 ` [PATCH 3/5 v10] ARM: Define the virtual space of KASan's shadow region Linus Walleij
2020-06-15  9:02 ` [PATCH 4/5 v10] ARM: Initialize the mapping of KASan shadow memory Linus Walleij
2020-06-15 14:33   ` Mike Rapoport
2020-06-30 13:22     ` Linus Walleij [this message]
2020-06-30 14:45       ` Mike Rapoport
2020-06-29 14:07   ` Linus Walleij
2020-06-29 14:37     ` Russell King - ARM Linux admin
2020-06-30  9:38       ` Linus Walleij
2020-06-15  9:02 ` [PATCH 5/5 v10] ARM: Enable KASan for ARM Linus Walleij

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=CACRpkdZvQgPXBsdUO1JwBW0gE-Jhse0s8U0-Y5BGCcxkq_Ue2g@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=liuwenliang@huawei.com \
    --cc=rppt@linux.ibm.com \
    /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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git