linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kfence: fix implicit function declaration
@ 2020-12-04 12:18 Anders Roxell
  2020-12-04 12:29 ` Alexander Potapenko
  2020-12-04 12:38 ` Marco Elver
  0 siblings, 2 replies; 4+ messages in thread
From: Anders Roxell @ 2020-12-04 12:18 UTC (permalink / raw)
  To: akpm, glider, elver, dvyukov, catalin.marinas, will
  Cc: kasan-dev, linux-arm-kernel, linux-kernel, Anders Roxell

When building kfence the following error shows up:

In file included from mm/kfence/report.c:13:
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);
      |  ^~~~~~~~~~~~~~~~

Use the correct include both
f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled")
and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the
same day via different trees.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---

I got this build error in todays next-20201204.
Andrew, since both patches are in your -mm tree, I think this can be
folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

 arch/arm64/include/asm/kfence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


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

* Re: [PATCH] kfence: fix implicit function declaration
  2020-12-04 12:18 [PATCH] kfence: fix implicit function declaration Anders Roxell
@ 2020-12-04 12:29 ` Alexander Potapenko
  2020-12-04 12:38 ` Marco Elver
  1 sibling, 0 replies; 4+ messages in thread
From: Alexander Potapenko @ 2020-12-04 12:29 UTC (permalink / raw)
  To: Anders Roxell
  Cc: Andrew Morton, Marco Elver, Dmitriy Vyukov, Catalin Marinas,
	Will Deacon, kasan-dev, Linux ARM, LKML

On Fri, Dec 4, 2020 at 1:18 PM Anders Roxell <anders.roxell@linaro.org> wrote:
>
> When building kfence the following error shows up:
>
> In file included from mm/kfence/report.c:13:
> 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);
>       |  ^~~~~~~~~~~~~~~~
>
> Use the correct include both
> f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled")
> and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the
> same day via different trees.
>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Reviewed-by: Alexander Potapenko <glider@google.com>


Thanks!

> ---
>
> I got this build error in todays next-20201204.
> Andrew, since both patches are in your -mm tree, I think this can be
> folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")
>
>  arch/arm64/include/asm/kfence.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
> index 6c0afeeab635..c44bb368a810 100644
> --- a/arch/arm64/include/asm/kfence.h
> +++ b/arch/arm64/include/asm/kfence.h
> @@ -3,7 +3,7 @@
>  #ifndef __ASM_KFENCE_H
>  #define __ASM_KFENCE_H
>
> -#include <asm/cacheflush.h>
> +#include <asm/set_memory.h>
>
>  static inline bool arch_kfence_init_pool(void) { return true; }
>
> --
> 2.29.2
>


-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

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

* Re: [PATCH] kfence: fix implicit function declaration
  2020-12-04 12:18 [PATCH] kfence: fix implicit function declaration Anders Roxell
  2020-12-04 12:29 ` Alexander Potapenko
@ 2020-12-04 12:38 ` Marco Elver
  2021-01-25 22:45   ` Andrew Morton
  1 sibling, 1 reply; 4+ messages in thread
From: Marco Elver @ 2020-12-04 12:38 UTC (permalink / raw)
  To: Anders Roxell
  Cc: akpm, glider, dvyukov, catalin.marinas, will, kasan-dev,
	linux-arm-kernel, linux-kernel, rppt, david

On Fri, Dec 04, 2020 at 01:18PM +0100, Anders Roxell wrote:
> When building kfence the following error shows up:
> 
> In file included from mm/kfence/report.c:13:
> 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);
>       |  ^~~~~~~~~~~~~~~~
> 
> Use the correct include both
> f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled")
> and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the

Note that -mm does not have stable commit hashes.

> same day via different trees.
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---

Ack, we need this patch somewhere but we should probably fix the patch
that does the move, otherwise we'll have a build-broken kernel still.

> I got this build error in todays next-20201204.
> Andrew, since both patches are in your -mm tree, I think this can be
> folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")

I don't think that's the right way around. This would result in a
build-broken commit point as well.

Looking at current -next, I see that "set_memory: allow querying whether
set_direct_map_*() is actually enabled" is after "arm64, kfence: enable
KFENCE for ARM64".

I think the patch that introduces set_memory.h for arm64 simply needs to
squash in this patch (assuming the order is retained as-is in -mm).

Thanks,
-- Marco

>  arch/arm64/include/asm/kfence.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/include/asm/kfence.h b/arch/arm64/include/asm/kfence.h
> index 6c0afeeab635..c44bb368a810 100644
> --- a/arch/arm64/include/asm/kfence.h
> +++ b/arch/arm64/include/asm/kfence.h
> @@ -3,7 +3,7 @@
>  #ifndef __ASM_KFENCE_H
>  #define __ASM_KFENCE_H
>  
> -#include <asm/cacheflush.h>
> +#include <asm/set_memory.h>
>  
>  static inline bool arch_kfence_init_pool(void) { return true; }
>  

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

* Re: [PATCH] kfence: fix implicit function declaration
  2020-12-04 12:38 ` Marco Elver
@ 2021-01-25 22:45   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2021-01-25 22:45 UTC (permalink / raw)
  To: Marco Elver
  Cc: Anders Roxell, glider, dvyukov, catalin.marinas, will, kasan-dev,
	linux-arm-kernel, linux-kernel, rppt, david

On Fri, 4 Dec 2020 13:38:25 +0100 Marco Elver <elver@google.com> wrote:

> On Fri, Dec 04, 2020 at 01:18PM +0100, Anders Roxell wrote:
> > When building kfence the following error shows up:
> > 
> > In file included from mm/kfence/report.c:13:
> > 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);
> >       |  ^~~~~~~~~~~~~~~~
> > 
> > Use the correct include both
> > f2b7c491916d ("set_memory: allow querying whether set_direct_map_*() is actually enabled")
> > and 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64") went in the
> 
> Note that -mm does not have stable commit hashes.
> 
> > same day via different trees.
> > 
> > Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> > ---
> 
> Ack, we need this patch somewhere but we should probably fix the patch
> that does the move, otherwise we'll have a build-broken kernel still.
> 
> > I got this build error in todays next-20201204.
> > Andrew, since both patches are in your -mm tree, I think this can be
> > folded into 4c4c75881536 ("arm64, kfence: enable KFENCE for ARM64")
> 
> I don't think that's the right way around. This would result in a
> build-broken commit point as well.
> 
> Looking at current -next, I see that "set_memory: allow querying whether
> set_direct_map_*() is actually enabled" is after "arm64, kfence: enable
> KFENCE for ARM64".
> 
> I think the patch that introduces set_memory.h for arm64 simply needs to
> squash in this patch (assuming the order is retained as-is in -mm).
> 

OK, I requeued this patch as
set_memory-allow-querying-whether-set_direct_map_-is-actually-enabled-fix.patch, part of Mike's secretmem patch series.

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

end of thread, other threads:[~2021-01-25 22:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 12:18 [PATCH] kfence: fix implicit function declaration Anders Roxell
2020-12-04 12:29 ` Alexander Potapenko
2020-12-04 12:38 ` Marco Elver
2021-01-25 22:45   ` Andrew Morton

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).