All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Peter Collingbourne <pcc@google.com>,
	Evgenii Stepanov <eugenis@google.com>,
	Branislav Rankov <Branislav.Rankov@arm.com>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS
Date: Mon, 8 Mar 2021 15:14:21 +0100	[thread overview]
Message-ID: <CAAeHK+zGDDhpzHqBrKcYhY3UvDG8iXfkCBVQ-5Se0QyESpQ91Q@mail.gmail.com> (raw)
In-Reply-To: <YEYMDn/9zQI8g+3o@elver.google.com>

On Mon, Mar 8, 2021 at 12:35 PM Marco Elver <elver@google.com> wrote:
>
> > -     kasan_free_nondeferred_pages(page, order, fpi_flags);
> > +     init = want_init_on_free();
> > +     if (init && !IS_ENABLED(CONFIG_KASAN_HW_TAGS))
>
> Doing the !IS_ENABLED(CONFIG_KASAN_HW_TAGS) check is awkward, and
> assumes internal knowledge of the KASAN implementation and how all
> current and future architectures that support HW_TAGS work.
>
> Could we instead add a static inline helper to <linux/kasan.h>, e.g.
> kasan_supports_init() or so?
>
> That way, these checks won't grow uncontrollable if a future
> architecture implements HW_TAGS but not init.

Good idea, I'll add a helper in v2.

> Hmm, KASAN certainly "supports" memory initialization always. So maybe
> "kasan_has_accelerated_init()" is more accurate?  I leave it to you to
> decide what the best option is.

Let's call it kasan_has_integrated_init().

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Andrey Konovalov <andreyknvl@google.com>
To: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	 Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Peter Collingbourne <pcc@google.com>,
	Evgenii Stepanov <eugenis@google.com>,
	Branislav Rankov <Branislav.Rankov@arm.com>,
	 Kevin Brodsky <kevin.brodsky@arm.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS
Date: Mon, 8 Mar 2021 15:14:21 +0100	[thread overview]
Message-ID: <CAAeHK+zGDDhpzHqBrKcYhY3UvDG8iXfkCBVQ-5Se0QyESpQ91Q@mail.gmail.com> (raw)
In-Reply-To: <YEYMDn/9zQI8g+3o@elver.google.com>

On Mon, Mar 8, 2021 at 12:35 PM Marco Elver <elver@google.com> wrote:
>
> > -     kasan_free_nondeferred_pages(page, order, fpi_flags);
> > +     init = want_init_on_free();
> > +     if (init && !IS_ENABLED(CONFIG_KASAN_HW_TAGS))
>
> Doing the !IS_ENABLED(CONFIG_KASAN_HW_TAGS) check is awkward, and
> assumes internal knowledge of the KASAN implementation and how all
> current and future architectures that support HW_TAGS work.
>
> Could we instead add a static inline helper to <linux/kasan.h>, e.g.
> kasan_supports_init() or so?
>
> That way, these checks won't grow uncontrollable if a future
> architecture implements HW_TAGS but not init.

Good idea, I'll add a helper in v2.

> Hmm, KASAN certainly "supports" memory initialization always. So maybe
> "kasan_has_accelerated_init()" is more accurate?  I leave it to you to
> decide what the best option is.

Let's call it kasan_has_integrated_init().

Thanks!

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

  parent reply	other threads:[~2021-03-08 14:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06  0:15 [PATCH 0/5] kasan: integrate with init_on_alloc/free Andrey Konovalov
2021-03-06  0:15 ` Andrey Konovalov
2021-03-06  0:15 ` Andrey Konovalov
2021-03-06  0:15 ` [PATCH 1/5] arm64: kasan: allow to init memory when setting tags Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-08 11:22   ` Marco Elver
2021-03-08 11:22     ` Marco Elver
2021-03-06  0:15 ` [PATCH 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-08 11:26   ` Marco Elver
2021-03-08 11:26     ` Marco Elver
2021-03-06  0:15 ` [PATCH 3/5] kasan, mm: integrate page_alloc init with HW_TAGS Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-08 11:35   ` Marco Elver
2021-03-08 11:35     ` Marco Elver
2021-03-08 11:50     ` Marco Elver
2021-03-08 11:50       ` Marco Elver
2021-03-08 11:50       ` Marco Elver
2021-03-08 14:14     ` Andrey Konovalov [this message]
2021-03-08 14:14       ` Andrey Konovalov
2021-03-08 14:14       ` Andrey Konovalov
2021-03-06  0:15 ` [PATCH 4/5] kasan, mm: integrate slab init_on_alloc " Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-08 11:36   ` Marco Elver
2021-03-08 11:36     ` Marco Elver
2021-03-06  0:15 ` [PATCH 5/5] kasan, mm: integrate slab init_on_free " Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-06  0:15   ` Andrey Konovalov
2021-03-08 11:45   ` Marco Elver
2021-03-08 11:45     ` Marco Elver
2021-03-08 14:16     ` Andrey Konovalov
2021-03-08 14:16       ` Andrey Konovalov
2021-03-08 14:16       ` Andrey Konovalov

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=CAAeHK+zGDDhpzHqBrKcYhY3UvDG8iXfkCBVQ-5Se0QyESpQ91Q@mail.gmail.com \
    --to=andreyknvl@google.com \
    --cc=Branislav.Rankov@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=eugenis@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pcc@google.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=will.deacon@arm.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
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.