linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c
@ 2020-12-05 17:22 Hui Su
  2020-12-06 21:23 ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Hui Su @ 2020-12-05 17:22 UTC (permalink / raw)
  To: glider, elver, dvyukov, catalin.marinas, will, kasan-dev,
	linux-arm-kernel, linux-kernel
  Cc: sh_def, sfr

When I build kernel with ARCH=arm64, the building errors came out like
this:
  CC      mm/kfence/core.o
In file included from ../mm/kfence/core.c:21:
../arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
../arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of
function ‘set_memory_valid’ [-Werror=implicit-function-declaration]
   12 |  set_memory_valid(addr, 1, !protect);
      |  ^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

which introduced by commit d54febeba2ff ("kfence: use pt_regs to
generate stack trace on faults").

Signed-off-by: Hui Su <sh_def@163.com>
---
 arch/arm64/include/asm/kfence.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
index 6c0afeeab635..4d73e34da59d 100644
--- a/arch/arm64/include/asm/kfence.h
+++ b/arch/arm64/include/asm/kfence.h
@@ -4,6 +4,7 @@
 #define __ASM_KFENCE_H
 
 #include <asm/cacheflush.h>
+#include <linux/set_memory.h>
 
 static inline bool arch_kfence_init_pool(void) { return true; }
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c
  2020-12-05 17:22 [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c Hui Su
@ 2020-12-06 21:23 ` Stephen Rothwell
  2020-12-06 22:08   ` Marco Elver
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2020-12-06 21:23 UTC (permalink / raw)
  To: Hui Su
  Cc: glider, elver, dvyukov, catalin.marinas, will, kasan-dev,
	linux-arm-kernel, linux-kernel, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]

Hi all,

[Cc'd Andrew Morton]

On Sun, 6 Dec 2020 01:22:07 +0800 Hui Su <sh_def@163.com> wrote:
>
> When I build kernel with ARCH=arm64, the building errors came out like
> this:
>   CC      mm/kfence/core.o
> In file included from ../mm/kfence/core.c:21:
> ../arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
> ../arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of
> function ‘set_memory_valid’ [-Werror=implicit-function-declaration]
>    12 |  set_memory_valid(addr, 1, !protect);
>       |  ^~~~~~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 
> which introduced by commit d54febeba2ff ("kfence: use pt_regs to
> generate stack trace on faults").
> 
> Signed-off-by: Hui Su <sh_def@163.com>
> ---
>  arch/arm64/include/asm/kfence.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
> index 6c0afeeab635..4d73e34da59d 100644
> --- a/arch/arm64/include/asm/kfence.h
> +++ b/arch/arm64/include/asm/kfence.h
> @@ -4,6 +4,7 @@
>  #define __ASM_KFENCE_H
>  
>  #include <asm/cacheflush.h>
> +#include <linux/set_memory.h>
>  
>  static inline bool arch_kfence_init_pool(void) { return true; }
>  
> -- 
> 2.25.1

Added to linux-next today.  I think it actually fixes patch "arm64,
kfence: enable KFENCE for ARM64" since that actually introduces the
set_memory_valid() call?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c
  2020-12-06 21:23 ` Stephen Rothwell
@ 2020-12-06 22:08   ` Marco Elver
  2020-12-07 14:52     ` Marco Elver
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Elver @ 2020-12-06 22:08 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Hui Su, Alexander Potapenko, Dmitry Vyukov, Catalin Marinas,
	Will Deacon, kasan-dev, Linux ARM, LKML, Andrew Morton

On Sun, 6 Dec 2020 at 22:23, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> [Cc'd Andrew Morton]
>
> On Sun, 6 Dec 2020 01:22:07 +0800 Hui Su <sh_def@163.com> wrote:
> >
> > When I build kernel with ARCH=arm64, the building errors came out like
> > this:
> >   CC      mm/kfence/core.o
> > In file included from ../mm/kfence/core.c:21:
> > ../arch/arm64/include/asm/kfence.h: In function ‘kfence_protect_page’:
> > ../arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of
> > function ‘set_memory_valid’ [-Werror=implicit-function-declaration]
> >    12 |  set_memory_valid(addr, 1, !protect);
> >       |  ^~~~~~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> >
> > which introduced by commit d54febeba2ff ("kfence: use pt_regs to
> > generate stack trace on faults").
> >
> > Signed-off-by: Hui Su <sh_def@163.com>
> > ---
> >  arch/arm64/include/asm/kfence.h | 1 +
> >  1 file changed, 1 insertion(+)

Thanks, but a patch for this is already in the -mm tree:
https://lore.kernel.org/mm-commits/20201205011409.o9PNsRntR%25akpm@linux-foundation.org/

Perhaps try the latest -next?

> > diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
> > index 6c0afeeab635..4d73e34da59d 100644
> > --- a/arch/arm64/include/asm/kfence.h
> > +++ b/arch/arm64/include/asm/kfence.h
> > @@ -4,6 +4,7 @@
> >  #define __ASM_KFENCE_H
> >
> >  #include <asm/cacheflush.h>
> > +#include <linux/set_memory.h>
> >
> >  static inline bool arch_kfence_init_pool(void) { return true; }
> >
> > --
> > 2.25.1
>
> Added to linux-next today.  I think it actually fixes patch "arm64,
> kfence: enable KFENCE for ARM64" since that actually introduces the
> set_memory_valid() call?

The patch that moved the declaration was after the kfence patch, so
it'd be the other way around:
https://lkml.kernel.org/r/X8otwahnmGQGLpge@elver.google.com

Thanks,
-- Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c
  2020-12-06 22:08   ` Marco Elver
@ 2020-12-07 14:52     ` Marco Elver
  2020-12-07 20:32       ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Elver @ 2020-12-07 14:52 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Hui Su, Alexander Potapenko, Dmitry Vyukov, Catalin Marinas,
	Will Deacon, kasan-dev, Linux ARM, LKML, Andrew Morton

On Sun, 6 Dec 2020 at 23:08, Marco Elver <elver@google.com> wrote:
> On Sun, 6 Dec 2020 at 22:23, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
[...]
> > > ../arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of
> > > function ‘set_memory_valid’ [-Werror=implicit-function-declaration]
> > >    12 |  set_memory_valid(addr, 1, !protect);
> > >       |  ^~~~~~~~~~~~~~~~
> > > cc1: some warnings being treated as errors
> > >
> > > which introduced by commit d54febeba2ff ("kfence: use pt_regs to
> > > generate stack trace on faults").
> > >
> > > Signed-off-by: Hui Su <sh_def@163.com>
> > > ---
> > >  arch/arm64/include/asm/kfence.h | 1 +
> > >  1 file changed, 1 insertion(+)
>
> Thanks, but a patch for this is already in the -mm tree:
> https://lore.kernel.org/mm-commits/20201205011409.o9PNsRntR%25akpm@linux-foundation.org/
>
> Perhaps try the latest -next?

Although I notice that patch somehow was dropped from -mm, or maybe
I'm not looking hard enough?

> > > diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
> > > index 6c0afeeab635..4d73e34da59d 100644
> > > --- a/arch/arm64/include/asm/kfence.h
> > > +++ b/arch/arm64/include/asm/kfence.h
> > > @@ -4,6 +4,7 @@
> > >  #define __ASM_KFENCE_H
> > >
> > >  #include <asm/cacheflush.h>
> > > +#include <linux/set_memory.h>

I preferred the patch at

  https://lore.kernel.org/mm-commits/20201205011409.o9PNsRntR%25akpm@linux-foundation.org/

because it removed <asm/cacheflush.h> and only included <asm/set_memory.h>.

I hope the right patch finds its way into the queue. :-)

Thanks,
-- Marco

> > >  static inline bool arch_kfence_init_pool(void) { return true; }
> > >
> > > --
> > > 2.25.1
> >
> > Added to linux-next today.  I think it actually fixes patch "arm64,
> > kfence: enable KFENCE for ARM64" since that actually introduces the
> > set_memory_valid() call?
>
> The patch that moved the declaration was after the kfence patch, so
> it'd be the other way around:
> https://lkml.kernel.org/r/X8otwahnmGQGLpge@elver.google.com
>
> Thanks,
> -- Marco

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c
  2020-12-07 14:52     ` Marco Elver
@ 2020-12-07 20:32       ` Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2020-12-07 20:32 UTC (permalink / raw)
  To: Marco Elver
  Cc: Hui Su, Alexander Potapenko, Dmitry Vyukov, Catalin Marinas,
	Will Deacon, kasan-dev, Linux ARM, LKML, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

Hi Marco,

On Mon, 7 Dec 2020 15:52:07 +0100 Marco Elver <elver@google.com> wrote:
>
> On Sun, 6 Dec 2020 at 23:08, Marco Elver <elver@google.com> wrote:
> > On Sun, 6 Dec 2020 at 22:23, Stephen Rothwell <sfr@canb.auug.org.au> wrote:  
> [...]
> > > > ../arch/arm64/include/asm/kfence.h:12:2: error: implicit declaration of
> > > > function ‘set_memory_valid’ [-Werror=implicit-function-declaration]
> > > >    12 |  set_memory_valid(addr, 1, !protect);
> > > >       |  ^~~~~~~~~~~~~~~~
> > > > cc1: some warnings being treated as errors
> > > >
> > > > which introduced by commit d54febeba2ff ("kfence: use pt_regs to
> > > > generate stack trace on faults").
> > > >
> > > > Signed-off-by: Hui Su <sh_def@163.com>
> > > > ---
> > > >  arch/arm64/include/asm/kfence.h | 1 +
> > > >  1 file changed, 1 insertion(+)  
> >
> > Thanks, but a patch for this is already in the -mm tree:
> > https://lore.kernel.org/mm-commits/20201205011409.o9PNsRntR%25akpm@linux-foundation.org/
> >
> > Perhaps try the latest -next?  
> 
> Although I notice that patch somehow was dropped from -mm, or maybe
> I'm not looking hard enough?

It may just be that Andrew has not published that version of his patch
series yet.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-07 20:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 17:22 [PATCH][next] arm64: fix the mm build error in mm/kfence/core.c Hui Su
2020-12-06 21:23 ` Stephen Rothwell
2020-12-06 22:08   ` Marco Elver
2020-12-07 14:52     ` Marco Elver
2020-12-07 20:32       ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).