linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Alexander Potapenko <glider@google.com>,
	 Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	 Will Deacon <will.deacon@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 v2 1/5] arm64: kasan: allow to init memory when setting tags
Date: Tue, 9 Mar 2021 14:09:21 +0100	[thread overview]
Message-ID: <CAAeHK+yaHufdycvawHAQ-Lt9GHKrGkzKkdJnTA3qN1MTtwiS5g@mail.gmail.com> (raw)
In-Reply-To: <20210308165847.GF15644@arm.com>

On Mon, Mar 8, 2021 at 5:58 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Mon, Mar 08, 2021 at 04:55:14PM +0100, Andrey Konovalov wrote:
> > @@ -68,10 +69,16 @@ static inline void mte_set_mem_tag_range(void *addr, size_t size, u8 tag)
> >                * 'asm volatile' is required to prevent the compiler to move
> >                * the statement outside of the loop.
> >                */
> > -             asm volatile(__MTE_PREAMBLE "stg %0, [%0]"
> > -                          :
> > -                          : "r" (curr)
> > -                          : "memory");
> > +             if (init)
> > +                     asm volatile(__MTE_PREAMBLE "stzg %0, [%0]"
> > +                                  :
> > +                                  : "r" (curr)
> > +                                  : "memory");
> > +             else
> > +                     asm volatile(__MTE_PREAMBLE "stg %0, [%0]"
> > +                                  :
> > +                                  : "r" (curr)
> > +                                  : "memory");
> >
> >               curr += MTE_GRANULE_SIZE;
> >       } while (curr != end);
>
> Is 'init' always a built-in constant here? If not, checking it once
> outside the loop may be better (or check the code generation, maybe the
> compiler is smart enough).

I think it's worth moving the init check outside the loop anyway. Will do in v3.

Thanks!


  reply	other threads:[~2021-03-09 13:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 15:55 [PATCH v2 0/5] kasan: integrate with init_on_alloc/free Andrey Konovalov
2021-03-08 15:55 ` [PATCH v2 1/5] arm64: kasan: allow to init memory when setting tags Andrey Konovalov
2021-03-08 16:58   ` Catalin Marinas
2021-03-09 13:09     ` Andrey Konovalov [this message]
2021-03-08 15:55 ` [PATCH v2 2/5] kasan: init memory in kasan_(un)poison for HW_TAGS Andrey Konovalov
2021-03-08 15:55 ` [PATCH v2 3/5] kasan, mm: integrate page_alloc init with HW_TAGS Andrey Konovalov
2021-03-08 16:07   ` Marco Elver
2021-03-08 15:55 ` [PATCH v2 4/5] kasan, mm: integrate slab init_on_alloc " Andrey Konovalov
2021-03-08 16:24   ` Marco Elver
2021-03-08 15:55 ` [PATCH v2 5/5] kasan, mm: integrate slab init_on_free " Andrey Konovalov
2021-03-08 16:27   ` Marco Elver

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+yaHufdycvawHAQ-Lt9GHKrGkzKkdJnTA3qN1MTtwiS5g@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox