linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
@ 2020-06-13 16:28 Arseny Solokha
  2020-06-13 17:28 ` Christophe Leroy
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Arseny Solokha @ 2020-06-13 16:28 UTC (permalink / raw)
  To: Michael Ellerman, Jason Yan, linuxppc-dev
  Cc: Scott Wood, Christophe Leroy, Arseny Solokha, linux-kernel, stable

Building the current 5.8 kernel for a e500 machine with
CONFIG_RANDOMIZE_BASE set yields the following failure:

  arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
  arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
[-Werror=implicit-function-declaration]

Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build.

The issue dates back to the introduction of that file and probably went
unnoticed because there's no in-tree defconfig with CONFIG_RANDOMIZE_BASE
set.

Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure")
Cc: stable@vger.kernel.org
Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
---
 arch/powerpc/mm/nohash/kaslr_booke.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c b/arch/powerpc/mm/nohash/kaslr_booke.c
index 4a75f2d9bf0e..bce0e5349978 100644
--- a/arch/powerpc/mm/nohash/kaslr_booke.c
+++ b/arch/powerpc/mm/nohash/kaslr_booke.c
@@ -14,6 +14,7 @@
 #include <linux/memblock.h>
 #include <linux/libfdt.h>
 #include <linux/crash_core.h>
+#include <asm/cacheflush.h>
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
 #include <asm/kdump.h>
-- 
2.27.0


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

* Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
  2020-06-13 16:28 [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE Arseny Solokha
@ 2020-06-13 17:28 ` Christophe Leroy
  2020-06-13 21:20   ` Arseny Solokha
  2020-06-15  1:19 ` Jason Yan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2020-06-13 17:28 UTC (permalink / raw)
  To: Arseny Solokha, Michael Ellerman, Jason Yan, linuxppc-dev
  Cc: Scott Wood, Christophe Leroy, linux-kernel, stable



Le 13/06/2020 à 18:28, Arseny Solokha a écrit :
> Building the current 5.8 kernel for a e500 machine with
> CONFIG_RANDOMIZE_BASE set yields the following failure:
> 
>    arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
>    arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
> of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
> [-Werror=implicit-function-declaration]
> 
> Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build.
> 
> The issue dates back to the introduction of that file and probably went
> unnoticed because there's no in-tree defconfig with CONFIG_RANDOMIZE_BASE
> set.

I don't get this problem with mpc85xx_defconfig + RELOCATABLE + 
RANDOMIZE_BASE.

Christophe

> 
> Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
> ---
>   arch/powerpc/mm/nohash/kaslr_booke.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c b/arch/powerpc/mm/nohash/kaslr_booke.c
> index 4a75f2d9bf0e..bce0e5349978 100644
> --- a/arch/powerpc/mm/nohash/kaslr_booke.c
> +++ b/arch/powerpc/mm/nohash/kaslr_booke.c
> @@ -14,6 +14,7 @@
>   #include <linux/memblock.h>
>   #include <linux/libfdt.h>
>   #include <linux/crash_core.h>
> +#include <asm/cacheflush.h>
>   #include <asm/pgalloc.h>
>   #include <asm/prom.h>
>   #include <asm/kdump.h>
> 

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

* Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
  2020-06-13 17:28 ` Christophe Leroy
@ 2020-06-13 21:20   ` Arseny Solokha
  0 siblings, 0 replies; 6+ messages in thread
From: Arseny Solokha @ 2020-06-13 21:20 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Christophe Leroy, Jason Yan, linux-kernel, stable, Scott Wood,
	Arseny Solokha, linuxppc-dev

> Le 13/06/2020 à 18:28, Arseny Solokha a écrit :
>> Building the current 5.8 kernel for a e500 machine with
>> CONFIG_RANDOMIZE_BASE set yields the following failure:
>>
>>    arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
>>    arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
>> of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
>> [-Werror=implicit-function-declaration]
>>
>> Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build.
>>
>> The issue dates back to the introduction of that file and probably went
>> unnoticed because there's no in-tree defconfig with CONFIG_RANDOMIZE_BASE
>> set.
>
> I don't get this problem with mpc85xx_defconfig + RELOCATABLE +
> RANDOMIZE_BASE.

Ah, OK. So the critical difference between mpc85xx_defconfig and our custom
config is that the former sets CONFIG_BLOCK while ours doesn't. Then we have the
following dependence chain:

arch/powerpc/mm/nohash/kaslr_booke.c
  include/linux/swap.h
    include/linux/memcontrol.h
      include/linux/writeback.h
        include/linux/blk-cgroup.h
          include/linux/blkdev.h

          #ifdef CONFIG_BLOCK
          #include <linux/pagemap.h>
          #endif

          include/linux/pagemap.h
            include/linux/highmem.h
              arch/powerpc/include/asm/cacheflush.h

and that's how the latter doesn't get included in
arch/powerpc/mm/nohash/kaslr_booke.c, because in our config CONFIG_BLOCK is not
defined in the first place.

Arseny

> Christophe
>
>>
>> Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
>> ---
>>   arch/powerpc/mm/nohash/kaslr_booke.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c b/arch/powerpc/mm/nohash/kaslr_booke.c
>> index 4a75f2d9bf0e..bce0e5349978 100644
>> --- a/arch/powerpc/mm/nohash/kaslr_booke.c
>> +++ b/arch/powerpc/mm/nohash/kaslr_booke.c
>> @@ -14,6 +14,7 @@
>>   #include <linux/memblock.h>
>>   #include <linux/libfdt.h>
>>   #include <linux/crash_core.h>
>> +#include <asm/cacheflush.h>
>>   #include <asm/pgalloc.h>
>>   #include <asm/prom.h>
>>   #include <asm/kdump.h>
>>

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

* Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
  2020-06-13 16:28 [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE Arseny Solokha
  2020-06-13 17:28 ` Christophe Leroy
@ 2020-06-15  1:19 ` Jason Yan
  2020-06-15 14:53 ` Scott Wood
  2020-06-26  4:44 ` Michael Ellerman
  3 siblings, 0 replies; 6+ messages in thread
From: Jason Yan @ 2020-06-15  1:19 UTC (permalink / raw)
  To: Arseny Solokha, Michael Ellerman, linuxppc-dev
  Cc: Scott Wood, Christophe Leroy, linux-kernel, stable


在 2020/6/14 0:28, Arseny Solokha 写道:
> Building the current 5.8 kernel for a e500 machine with
> CONFIG_RANDOMIZE_BASE set yields the following failure:
> 
>    arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
>    arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
> of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
> [-Werror=implicit-function-declaration]
> 
> Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build.
> 
> The issue dates back to the introduction of that file and probably went
> unnoticed because there's no in-tree defconfig with CONFIG_RANDOMIZE_BASE
> set.
> 
> Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
> ---
>   arch/powerpc/mm/nohash/kaslr_booke.c | 1 +
>   1 file changed, 1 insertion(+)
> 

Reviewed-by: Jason Yan <yanaijie@huawei.com>


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

* Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
  2020-06-13 16:28 [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE Arseny Solokha
  2020-06-13 17:28 ` Christophe Leroy
  2020-06-15  1:19 ` Jason Yan
@ 2020-06-15 14:53 ` Scott Wood
  2020-06-26  4:44 ` Michael Ellerman
  3 siblings, 0 replies; 6+ messages in thread
From: Scott Wood @ 2020-06-15 14:53 UTC (permalink / raw)
  To: Arseny Solokha, Michael Ellerman, Jason Yan, linuxppc-dev
  Cc: Christophe Leroy, linux-kernel, stable

On Sat, 2020-06-13 at 23:28 +0700, Arseny Solokha wrote:
> Building the current 5.8 kernel for a e500 machine with
> CONFIG_RANDOMIZE_BASE set yields the following failure:
> 
>   arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
>   arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
> of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
> [-Werror=implicit-function-declaration]
> 
> Indeed, including asm/cacheflush.h into kaslr_booke.c fixes the build.
> 
> The issue dates back to the introduction of that file and probably went
> unnoticed because there's no in-tree defconfig with CONFIG_RANDOMIZE_BASE
> set.
> 
> Fixes: 2b0e86cc5de6 ("powerpc/fsl_booke/32: implement KASLR infrastructure")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arseny Solokha <asolokha@kb.kras.ru>
> ---
>  arch/powerpc/mm/nohash/kaslr_booke.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Scott Wood <oss@buserror.net>

-Scott



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

* Re: [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE
  2020-06-13 16:28 [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE Arseny Solokha
                   ` (2 preceding siblings ...)
  2020-06-15 14:53 ` Scott Wood
@ 2020-06-26  4:44 ` Michael Ellerman
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-06-26  4:44 UTC (permalink / raw)
  To: Arseny Solokha, Jason Yan, Michael Ellerman, linuxppc-dev
  Cc: Scott Wood, Christophe Leroy, linux-kernel, stable

On Sat, 13 Jun 2020 23:28:01 +0700, Arseny Solokha wrote:
> Building the current 5.8 kernel for a e500 machine with
> CONFIG_RANDOMIZE_BASE set yields the following failure:
> 
>   arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init':
>   arch/powerpc/mm/nohash/kaslr_booke.c:387:2: error: implicit declaration
> of function 'flush_icache_range'; did you mean 'flush_tlb_range'?
> [-Werror=implicit-function-declaration]
> 
> [...]

Applied to powerpc/fixes.

[1/1] powerpc/fsl_booke/32: Fix build with CONFIG_RANDOMIZE_BASE
      https://git.kernel.org/powerpc/c/7e4773f73dcfb92e7e33532162f722ec291e75a4

cheers

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

end of thread, other threads:[~2020-06-26  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 16:28 [PATCH] powerpc/fsl_booke/32: fix build with CONFIG_RANDOMIZE_BASE Arseny Solokha
2020-06-13 17:28 ` Christophe Leroy
2020-06-13 21:20   ` Arseny Solokha
2020-06-15  1:19 ` Jason Yan
2020-06-15 14:53 ` Scott Wood
2020-06-26  4:44 ` Michael Ellerman

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