From: Michael Ellerman <mpe@ellerman.id.au>
To: Marco Elver <elver@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: kernel test robot <lkp@intel.com>, Daniel Axtens <dja@axtens.net>,
linux-kernel@vger.kernel.org, Nicholas Piggin <npiggin@gmail.com>,
linux-mm@kvack.org, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Alexander Potapenko <glider@google.com>,
Liam Howlett <liam.howlett@oracle.com>,
kasan-dev@googlegroups.com,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
linuxppc-dev@lists.ozlabs.org, Dmitry Vyukov <dvyukov@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>
Subject: Re: [PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes
Date: Tue, 28 Feb 2023 22:58:03 +1100 [thread overview]
Message-ID: <87o7peuhmc.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CANpmjNNtxW41H8ju6iog=ynMdEE0awa7GYabsuL6ZRihmVYQHw@mail.gmail.com>
Marco Elver <elver@google.com> writes:
> On Mon, 27 Feb 2023 at 23:16, Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> On Mon, 27 Feb 2023 10:47:27 +0100 Marco Elver <elver@google.com> wrote:
>>
>> > With appropriate compiler support [1], KASAN builds use __asan prefixed
>> > meminstrinsics, and KASAN no longer overrides memcpy/memset/memmove.
>> >
>> > If compiler support is detected (CC_HAS_KASAN_MEMINTRINSIC_PREFIX),
>> > define memintrinsics normally (do not prefix '__').
>> >
>> > On powerpc, KASAN is the only user of __mem functions, which are used to
>> > define instrumented memintrinsics. Alias the normal versions for KASAN
>> > to use in its implementation.
>> >
>> > Link: https://lore.kernel.org/all/20230224085942.1791837-1-elver@google.com/ [1]
>> > Link: https://lore.kernel.org/oe-kbuild-all/202302271348.U5lvmo0S-lkp@intel.com/
>> > Reported-by: kernel test robot <lkp@intel.com>
>> > Signed-off-by: Marco Elver <elver@google.com>
>>
>> Seems this is a fix against "kasan: treat meminstrinsic as builtins in
>> uninstrumented files", so I'll plan to fold this patch into that patch.
>
> Yes, that looks right.
>
> If a powerpc maintainer could take a quick look as well would be good.
The patch looks OK to me. It builds for various configs and I did a few
test boots with KASAN enabled, everything seems normal.
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
> The maze of memcpy/memmove/memset definitions and redefinitions isn't
> the simplest - I hope in a few years we can delete all the old code
> (before CC_HAS_KASAN_MEMINTRINSIC_PREFIX), and let the compilers just
> "do the right thing".
Yeah that would be nice.
cheers
WARNING: multiple messages have this Message-ID (diff)
From: Michael Ellerman <mpe@ellerman.id.au>
To: Marco Elver <elver@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Alexander Potapenko <glider@google.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Dmitry Vyukov <dvyukov@google.com>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Liam Howlett <liam.howlett@oracle.com>,
kasan-dev@googlegroups.com, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Daniel Axtens <dja@axtens.net>, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes
Date: Tue, 28 Feb 2023 22:58:03 +1100 [thread overview]
Message-ID: <87o7peuhmc.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <CANpmjNNtxW41H8ju6iog=ynMdEE0awa7GYabsuL6ZRihmVYQHw@mail.gmail.com>
Marco Elver <elver@google.com> writes:
> On Mon, 27 Feb 2023 at 23:16, Andrew Morton <akpm@linux-foundation.org> wrote:
>>
>> On Mon, 27 Feb 2023 10:47:27 +0100 Marco Elver <elver@google.com> wrote:
>>
>> > With appropriate compiler support [1], KASAN builds use __asan prefixed
>> > meminstrinsics, and KASAN no longer overrides memcpy/memset/memmove.
>> >
>> > If compiler support is detected (CC_HAS_KASAN_MEMINTRINSIC_PREFIX),
>> > define memintrinsics normally (do not prefix '__').
>> >
>> > On powerpc, KASAN is the only user of __mem functions, which are used to
>> > define instrumented memintrinsics. Alias the normal versions for KASAN
>> > to use in its implementation.
>> >
>> > Link: https://lore.kernel.org/all/20230224085942.1791837-1-elver@google.com/ [1]
>> > Link: https://lore.kernel.org/oe-kbuild-all/202302271348.U5lvmo0S-lkp@intel.com/
>> > Reported-by: kernel test robot <lkp@intel.com>
>> > Signed-off-by: Marco Elver <elver@google.com>
>>
>> Seems this is a fix against "kasan: treat meminstrinsic as builtins in
>> uninstrumented files", so I'll plan to fold this patch into that patch.
>
> Yes, that looks right.
>
> If a powerpc maintainer could take a quick look as well would be good.
The patch looks OK to me. It builds for various configs and I did a few
test boots with KASAN enabled, everything seems normal.
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
> The maze of memcpy/memmove/memset definitions and redefinitions isn't
> the simplest - I hope in a few years we can delete all the old code
> (before CC_HAS_KASAN_MEMINTRINSIC_PREFIX), and let the compilers just
> "do the right thing".
Yeah that would be nice.
cheers
next prev parent reply other threads:[~2023-02-28 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 9:47 [PATCH mm] kasan, powerpc: Don't rename memintrinsics if compiler adds prefixes Marco Elver
2023-02-27 9:47 ` Marco Elver
2023-02-27 22:16 ` Andrew Morton
2023-02-27 22:16 ` Andrew Morton
2023-02-27 23:09 ` Marco Elver
2023-02-27 23:09 ` Marco Elver
2023-02-28 11:58 ` Michael Ellerman [this message]
2023-02-28 11:58 ` Michael Ellerman
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=87o7peuhmc.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=dja@axtens.net \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
--cc=npiggin@gmail.com \
--cc=ryabinin.a.a@gmail.com \
--cc=vincenzo.frascino@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.