All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Ard Biesheuvel <ardb@kernel.org>, Mike Rapoport <rppt@kernel.org>,
	Abbott Liu <liuwenliang@huawei.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: kasan: work around LPAE build warning
Date: Sat, 24 Jul 2021 00:51:32 +0200	[thread overview]
Message-ID: <CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com> (raw)
In-Reply-To: <20210721151706.2439073-1-arnd@kernel.org>

On Wed, Jul 21, 2021 at 5:17 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> pgd_page_vaddr() returns an 'unsigned long' address, causing a warning
> with the memcpy() call in kasan_init():
>
> arch/arm/mm/kasan_init.c: In function 'kasan_init':
> include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion]
>    44 | #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
>       |                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                  |
>       |                                                  long unsigned int
> arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy'
>    58 | #define memcpy(dst, src, len) __memcpy(dst, src, len)
>       |                                             ^~~
> arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr'
>   229 |                pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
>       |                ^~~~~~~~~~~~~~
> arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int'
>    21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n);
>       |                                   ~~~~~~~~~~~~^~~
>
> Avoid this by adding an explicit typecast.
>
> Fixes: 5615f69bc209 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I can't think of anything better.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Will you add this patch to Russell's patch tracker?

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	 Ard Biesheuvel <ardb@kernel.org>,
	Mike Rapoport <rppt@kernel.org>,
	Abbott Liu <liuwenliang@huawei.com>,
	 Arnd Bergmann <arnd@arndb.de>,
	Alexander Potapenko <glider@google.com>,
	 Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	 Florian Fainelli <f.fainelli@gmail.com>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: kasan: work around LPAE build warning
Date: Sat, 24 Jul 2021 00:51:32 +0200	[thread overview]
Message-ID: <CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com> (raw)
In-Reply-To: <20210721151706.2439073-1-arnd@kernel.org>

On Wed, Jul 21, 2021 at 5:17 PM Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
>
> pgd_page_vaddr() returns an 'unsigned long' address, causing a warning
> with the memcpy() call in kasan_init():
>
> arch/arm/mm/kasan_init.c: In function 'kasan_init':
> include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion]
>    44 | #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
>       |                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                  |
>       |                                                  long unsigned int
> arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy'
>    58 | #define memcpy(dst, src, len) __memcpy(dst, src, len)
>       |                                             ^~~
> arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr'
>   229 |                pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
>       |                ^~~~~~~~~~~~~~
> arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int'
>    21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n);
>       |                                   ~~~~~~~~~~~~^~~
>
> Avoid this by adding an explicit typecast.
>
> Fixes: 5615f69bc209 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I can't think of anything better.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Will you add this patch to Russell's patch tracker?

Yours,
Linus Walleij

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

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 15:16 [PATCH] ARM: kasan: work around LPAE build warning Arnd Bergmann
2021-07-21 15:16 ` Arnd Bergmann
2021-07-23 22:51 ` Linus Walleij [this message]
2021-07-23 22:51   ` 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='CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andreyknvl@gmail.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --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-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=liuwenliang@huawei.com \
    --cc=rppt@kernel.org \
    --cc=ryabinin.a.a@gmail.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.