All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Collingbourne <pcc@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Will Deacon <will@kernel.org>,
	 Andrey Konovalov <andreyknvl@gmail.com>,
	Evgenii Stepanov <eugenis@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled
Date: Tue, 7 Sep 2021 16:20:41 -0700	[thread overview]
Message-ID: <CAMn1gO7Bk1QiidXPChSC0=tT7fuK4zOEHTi_cJv03FrLq0PXnA@mail.gmail.com> (raw)
In-Reply-To: <YTZWwqxBsy09YKx0@arm.com>

On Mon, Sep 6, 2021 at 10:58 AM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Thu, Aug 26, 2021 at 08:07:48PM -0700, Peter Collingbourne wrote:
> > It is not necessary to write to GCR_EL1 on every kernel entry and
> > exit when HW tag-based KASAN is disabled because the kernel will not
> > execute any IRG instructions in that mode. Since accessing GCR_EL1
> > can be expensive on some microarchitectures, avoid doing so by moving
> > the access to task switch when HW tag-based KASAN is disabled.
>
> I haven't got a chance to look at this patch yet as it was posted pretty
> close to the merging window, so it wasn't on my urgent list (not a fix).
>
> What's the use-case exactly? Do you expect production kernels to have
> KASAN_HW built in but disabled on the command line?

Yes, KASAN_HW_TAGS will be enabled in the GKI, but we would still like
the flexibility of allowing vendors to disable it via the command
line. If they choose to do so, the overhead should be as small as
possible.

> I thought there's an
> overhead already from kasan even without MTE.

I believe that the intent is that KASAN_HW_TAGS on its own (with
kasan=off or on unsupported hardware) should not introduce any
significant overhead.

Peter

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

  reply	other threads:[~2021-09-07 23:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27  3:07 [PATCH] arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled Peter Collingbourne
2021-08-29 14:10 ` Andrey Konovalov
2021-09-03 22:12   ` Peter Collingbourne
2021-09-06 17:58 ` Catalin Marinas
2021-09-07 23:20   ` Peter Collingbourne [this message]
2021-09-09 17:39 ` Catalin Marinas
2021-09-10  2:12   ` Peter Collingbourne
2021-09-14 21:54 ` Peter Collingbourne

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='CAMn1gO7Bk1QiidXPChSC0=tT7fuK4zOEHTi_cJv03FrLq0PXnA@mail.gmail.com' \
    --to=pcc@google.com \
    --cc=andreyknvl@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=eugenis@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@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 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.