All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 13:58 ` Qian Cai
  0 siblings, 0 replies; 14+ messages in thread
From: Qian Cai @ 2020-08-06 13:58 UTC (permalink / raw)
  To: torvalds
  Cc: daniel.diaz, linux, tytso, catalin.marinas, will,
	linux-arm-kernel, linux-kernel, Qian Cai

linux-next failed to compile using this .config,
https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config

arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
'__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
[-Werror=implicit-function-declaration]
  if (__early_cpu_has_rndr()) {
      ^~~~~~~~~~~~~~~~~~~~
      __early_pfn_to_nid
arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
'__arm64_rndr' [-Werror=implicit-function-declaration]
   if (__arm64_rndr(&raw))
       ^~~~~~~~~~~~
cc1: some warnings being treated as errors

Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 include/linux/random.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/random.h b/include/linux/random.h
index f45b8be3e3c4..da782c16c20c 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -12,6 +12,8 @@
 #include <linux/list.h>
 #include <linux/once.h>
 
+#include <asm/archrandom.h>
+
 #include <uapi/linux/random.h>
 
 struct random_ready_callback {
-- 
2.18.4


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

* [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 13:58 ` Qian Cai
  0 siblings, 0 replies; 14+ messages in thread
From: Qian Cai @ 2020-08-06 13:58 UTC (permalink / raw)
  To: torvalds
  Cc: daniel.diaz, tytso, catalin.marinas, linux-kernel, Qian Cai,
	linux, will, linux-arm-kernel

linux-next failed to compile using this .config,
https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config

arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
'__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
[-Werror=implicit-function-declaration]
  if (__early_cpu_has_rndr()) {
      ^~~~~~~~~~~~~~~~~~~~
      __early_pfn_to_nid
arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
'__arm64_rndr' [-Werror=implicit-function-declaration]
   if (__arm64_rndr(&raw))
       ^~~~~~~~~~~~
cc1: some warnings being treated as errors

Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
Signed-off-by: Qian Cai <cai@lca.pw>
---
 include/linux/random.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/random.h b/include/linux/random.h
index f45b8be3e3c4..da782c16c20c 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -12,6 +12,8 @@
 #include <linux/list.h>
 #include <linux/once.h>
 
+#include <asm/archrandom.h>
+
 #include <uapi/linux/random.h>
 
 struct random_ready_callback {
-- 
2.18.4


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

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

* Re: [PATCH] random: fix a compilation error on arm64
  2020-08-06 13:58 ` Qian Cai
@ 2020-08-06 14:50   ` Guenter Roeck
  -1 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2020-08-06 14:50 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: daniel.diaz, tytso, catalin.marinas, will, linux-arm-kernel,
	linux-kernel

On 8/6/20 6:58 AM, Qian Cai wrote:
> linux-next failed to compile using this .config,
> https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> 
> arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> [-Werror=implicit-function-declaration]
>   if (__early_cpu_has_rndr()) {
>       ^~~~~~~~~~~~~~~~~~~~
>       __early_pfn_to_nid
> arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> '__arm64_rndr' [-Werror=implicit-function-declaration]
>    if (__arm64_rndr(&raw))
>        ^~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 

This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
would argue that __arm64_rndr() should not be called directly in the
first place. arch_get_random_seed_long_early() should be called instead.

Thanks,
Guenter

> Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  include/linux/random.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/random.h b/include/linux/random.h
> index f45b8be3e3c4..da782c16c20c 100644
> --- a/include/linux/random.h
> +++ b/include/linux/random.h
> @@ -12,6 +12,8 @@
>  #include <linux/list.h>
>  #include <linux/once.h>
>  
> +#include <asm/archrandom.h>
> +
>  #include <uapi/linux/random.h>
>  
>  struct random_ready_callback {
> 


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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 14:50   ` Guenter Roeck
  0 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2020-08-06 14:50 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: daniel.diaz, tytso, catalin.marinas, linux-kernel, will,
	linux-arm-kernel

On 8/6/20 6:58 AM, Qian Cai wrote:
> linux-next failed to compile using this .config,
> https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> 
> arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> [-Werror=implicit-function-declaration]
>   if (__early_cpu_has_rndr()) {
>       ^~~~~~~~~~~~~~~~~~~~
>       __early_pfn_to_nid
> arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> '__arm64_rndr' [-Werror=implicit-function-declaration]
>    if (__arm64_rndr(&raw))
>        ^~~~~~~~~~~~
> cc1: some warnings being treated as errors
> 

This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
would argue that __arm64_rndr() should not be called directly in the
first place. arch_get_random_seed_long_early() should be called instead.

Thanks,
Guenter

> Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  include/linux/random.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/random.h b/include/linux/random.h
> index f45b8be3e3c4..da782c16c20c 100644
> --- a/include/linux/random.h
> +++ b/include/linux/random.h
> @@ -12,6 +12,8 @@
>  #include <linux/list.h>
>  #include <linux/once.h>
>  
> +#include <asm/archrandom.h>
> +
>  #include <uapi/linux/random.h>
>  
>  struct random_ready_callback {
> 


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

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

* Re: [PATCH] random: fix a compilation error on arm64
  2020-08-06 13:58 ` Qian Cai
  (?)
@ 2020-08-06 22:01   ` kernel test robot
  -1 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:01 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: kbuild-all, clang-built-linux, daniel.diaz, linux, tytso,
	catalin.marinas, will, linux-arm-kernel, linux-kernel, Qian Cai

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: mips-randconfig-r015-20200805 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 076b120bebfd727b502208601012a44ab2e1028e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from kernel/fork.c:77:
>> include/linux/random.h:15:10: fatal error: 'asm/archrandom.h' file not found
   #include <asm/archrandom.h>
            ^~~~~~~~~~~~~~~~~~
   1 error generated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30753 bytes --]

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 22:01   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:01 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: daniel.diaz, kbuild-all, catalin.marinas, linux-kernel,
	clang-built-linux, Qian Cai, linux-arm-kernel, tytso, will,
	linux

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: mips-randconfig-r015-20200805 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 076b120bebfd727b502208601012a44ab2e1028e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from kernel/fork.c:77:
>> include/linux/random.h:15:10: fatal error: 'asm/archrandom.h' file not found
   #include <asm/archrandom.h>
            ^~~~~~~~~~~~~~~~~~
   1 error generated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30753 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

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

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 22:01   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:01 UTC (permalink / raw)
  To: kbuild-all

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: mips-randconfig-r015-20200805 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 076b120bebfd727b502208601012a44ab2e1028e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from kernel/fork.c:77:
>> include/linux/random.h:15:10: fatal error: 'asm/archrandom.h' file not found
   #include <asm/archrandom.h>
            ^~~~~~~~~~~~~~~~~~
   1 error generated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30753 bytes --]

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

* Re: [PATCH] random: fix a compilation error on arm64
  2020-08-06 13:58 ` Qian Cai
  (?)
@ 2020-08-06 22:25   ` kernel test robot
  -1 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:25 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: kbuild-all, daniel.diaz, linux, tytso, catalin.marinas, will,
	linux-arm-kernel, linux-kernel, Qian Cai

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master random/dev tytso-fscrypt/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: m68k-randconfig-r032-20200805 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/net.h:18,
                    from drivers/target/target_core_device.c:14:
>> include/linux/random.h:15:10: fatal error: asm/archrandom.h: No such file or directory
      15 | #include <asm/archrandom.h>
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 17904 bytes --]

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 22:25   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:25 UTC (permalink / raw)
  To: Qian Cai, torvalds
  Cc: daniel.diaz, tytso, catalin.marinas, linux-kernel, Qian Cai,
	linux-arm-kernel, kbuild-all, will, linux

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master random/dev tytso-fscrypt/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: m68k-randconfig-r032-20200805 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/net.h:18,
                    from drivers/target/target_core_device.c:14:
>> include/linux/random.h:15:10: fatal error: asm/archrandom.h: No such file or directory
      15 | #include <asm/archrandom.h>
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 17904 bytes --]

[-- Attachment #3: Type: text/plain, Size: 176 bytes --]

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

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 22:25   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2020-08-06 22:25 UTC (permalink / raw)
  To: kbuild-all

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

Hi Qian,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master random/dev tytso-fscrypt/master v5.8 next-20200806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Qian-Cai/random-fix-a-compilation-error-on-arm64/20200807-013039
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 47ec5303d73ea344e84f46660fff693c57641386
config: m68k-randconfig-r032-20200805 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/net.h:18,
                    from drivers/target/target_core_device.c:14:
>> include/linux/random.h:15:10: fatal error: asm/archrandom.h: No such file or directory
      15 | #include <asm/archrandom.h>
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.

vim +15 include/linux/random.h

    14	
  > 15	#include <asm/archrandom.h>
    16	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 17904 bytes --]

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

* Re: [PATCH] random: fix a compilation error on arm64
  2020-08-06 14:50   ` Guenter Roeck
@ 2020-08-06 22:43     ` Qian Cai
  -1 siblings, 0 replies; 14+ messages in thread
From: Qian Cai @ 2020-08-06 22:43 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: torvalds, daniel.diaz, tytso, catalin.marinas, will,
	linux-arm-kernel, linux-kernel, sfr, linux-next

On Thu, Aug 06, 2020 at 07:50:23AM -0700, Guenter Roeck wrote:
> On 8/6/20 6:58 AM, Qian Cai wrote:
> > linux-next failed to compile using this .config,
> > https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> > 
> > arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> > arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> > '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> > [-Werror=implicit-function-declaration]
> >   if (__early_cpu_has_rndr()) {
> >       ^~~~~~~~~~~~~~~~~~~~
> >       __early_pfn_to_nid
> > arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> > '__arm64_rndr' [-Werror=implicit-function-declaration]
> >    if (__arm64_rndr(&raw))
> >        ^~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> > 
> 
> This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
> would argue that __arm64_rndr() should not be called directly in the
> first place. arch_get_random_seed_long_early() should be called instead.

I am not sure about if that would cure possible ARCH_RANDOM=n compiling
failures on all arches. Since my patch would not compile on mips etc, an
alternative is to revert the buggy commit 585524081ecd for now. Any thought?

> 
> Thanks,
> Guenter
> 
> > Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> > Signed-off-by: Qian Cai <cai@lca.pw>
> > ---
> >  include/linux/random.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/linux/random.h b/include/linux/random.h
> > index f45b8be3e3c4..da782c16c20c 100644
> > --- a/include/linux/random.h
> > +++ b/include/linux/random.h
> > @@ -12,6 +12,8 @@
> >  #include <linux/list.h>
> >  #include <linux/once.h>
> >  
> > +#include <asm/archrandom.h>
> > +
> >  #include <uapi/linux/random.h>
> >  
> >  struct random_ready_callback {
> > 
> 

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-06 22:43     ` Qian Cai
  0 siblings, 0 replies; 14+ messages in thread
From: Qian Cai @ 2020-08-06 22:43 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: sfr, daniel.diaz, tytso, will, linux-kernel, linux-next,
	catalin.marinas, torvalds, linux-arm-kernel

On Thu, Aug 06, 2020 at 07:50:23AM -0700, Guenter Roeck wrote:
> On 8/6/20 6:58 AM, Qian Cai wrote:
> > linux-next failed to compile using this .config,
> > https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> > 
> > arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> > arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> > '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> > [-Werror=implicit-function-declaration]
> >   if (__early_cpu_has_rndr()) {
> >       ^~~~~~~~~~~~~~~~~~~~
> >       __early_pfn_to_nid
> > arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> > '__arm64_rndr' [-Werror=implicit-function-declaration]
> >    if (__arm64_rndr(&raw))
> >        ^~~~~~~~~~~~
> > cc1: some warnings being treated as errors
> > 
> 
> This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
> would argue that __arm64_rndr() should not be called directly in the
> first place. arch_get_random_seed_long_early() should be called instead.

I am not sure about if that would cure possible ARCH_RANDOM=n compiling
failures on all arches. Since my patch would not compile on mips etc, an
alternative is to revert the buggy commit 585524081ecd for now. Any thought?

> 
> Thanks,
> Guenter
> 
> > Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> > Signed-off-by: Qian Cai <cai@lca.pw>
> > ---
> >  include/linux/random.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/linux/random.h b/include/linux/random.h
> > index f45b8be3e3c4..da782c16c20c 100644
> > --- a/include/linux/random.h
> > +++ b/include/linux/random.h
> > @@ -12,6 +12,8 @@
> >  #include <linux/list.h>
> >  #include <linux/once.h>
> >  
> > +#include <asm/archrandom.h>
> > +
> >  #include <uapi/linux/random.h>
> >  
> >  struct random_ready_callback {
> > 
> 

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

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

* Re: [PATCH] random: fix a compilation error on arm64
  2020-08-06 22:43     ` Qian Cai
@ 2020-08-07  0:19       ` Guenter Roeck
  -1 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2020-08-07  0:19 UTC (permalink / raw)
  To: Qian Cai
  Cc: torvalds, daniel.diaz, tytso, catalin.marinas, will,
	linux-arm-kernel, linux-kernel, sfr, linux-next

On Thu, Aug 06, 2020 at 06:43:14PM -0400, Qian Cai wrote:
> On Thu, Aug 06, 2020 at 07:50:23AM -0700, Guenter Roeck wrote:
> > On 8/6/20 6:58 AM, Qian Cai wrote:
> > > linux-next failed to compile using this .config,
> > > https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> > > 
> > > arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> > > arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> > > '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> > > [-Werror=implicit-function-declaration]
> > >   if (__early_cpu_has_rndr()) {
> > >       ^~~~~~~~~~~~~~~~~~~~
> > >       __early_pfn_to_nid
> > > arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> > > '__arm64_rndr' [-Werror=implicit-function-declaration]
> > >    if (__arm64_rndr(&raw))
> > >        ^~~~~~~~~~~~
> > > cc1: some warnings being treated as errors
> > > 
> > 
> > This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
> > would argue that __arm64_rndr() should not be called directly in the
> > first place. arch_get_random_seed_long_early() should be called instead.
> 
> I am not sure about if that would cure possible ARCH_RANDOM=n compiling
> failures on all arches. Since my patch would not compile on mips etc, an
> alternative is to revert the buggy commit 585524081ecd for now. Any thought?
> 
It is quite unlikely that any other architecture would attempt to compile
any arm64 code (which is the only code touched by commit 585524081ecd).
Also, commit 585524081ecd fixes a different problem caused by the
recursive inclusion of asm/archrandom.h. On top of that, I think using
arch_get_random_seed_long_early() would be much cleaner than the current
code since it doesn't override/bypass ARCH_RANDOM.

Let's do it this way: I'll submit an alternate patch using
arch_get_random_seed_long_early(). This way Linus can decide how to
proceed, and we don't have to go back and forth.

Thanks,
Guenter

> > 
> > Thanks,
> > Guenter
> > 
> > > Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> > > Signed-off-by: Qian Cai <cai@lca.pw>
> > > ---
> > >  include/linux/random.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/include/linux/random.h b/include/linux/random.h
> > > index f45b8be3e3c4..da782c16c20c 100644
> > > --- a/include/linux/random.h
> > > +++ b/include/linux/random.h
> > > @@ -12,6 +12,8 @@
> > >  #include <linux/list.h>
> > >  #include <linux/once.h>
> > >  
> > > +#include <asm/archrandom.h>
> > > +
> > >  #include <uapi/linux/random.h>
> > >  
> > >  struct random_ready_callback {
> > > 
> > 

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

* Re: [PATCH] random: fix a compilation error on arm64
@ 2020-08-07  0:19       ` Guenter Roeck
  0 siblings, 0 replies; 14+ messages in thread
From: Guenter Roeck @ 2020-08-07  0:19 UTC (permalink / raw)
  To: Qian Cai
  Cc: sfr, daniel.diaz, tytso, will, linux-kernel, linux-next,
	catalin.marinas, torvalds, linux-arm-kernel

On Thu, Aug 06, 2020 at 06:43:14PM -0400, Qian Cai wrote:
> On Thu, Aug 06, 2020 at 07:50:23AM -0700, Guenter Roeck wrote:
> > On 8/6/20 6:58 AM, Qian Cai wrote:
> > > linux-next failed to compile using this .config,
> > > https://gitlab.com/cailca/linux-mm/-/blob/master/arm64.config
> > > 
> > > arch/arm64/kernel/kaslr.c: In function 'kaslr_early_init':
> > > arch/arm64/kernel/kaslr.c:128:6: error: implicit declaration of function
> > > '__early_cpu_has_rndr'; did you mean '__early_pfn_to_nid'?
> > > [-Werror=implicit-function-declaration]
> > >   if (__early_cpu_has_rndr()) {
> > >       ^~~~~~~~~~~~~~~~~~~~
> > >       __early_pfn_to_nid
> > > arch/arm64/kernel/kaslr.c:131:7: error: implicit declaration of function
> > > '__arm64_rndr' [-Werror=implicit-function-declaration]
> > >    if (__arm64_rndr(&raw))
> > >        ^~~~~~~~~~~~
> > > cc1: some warnings being treated as errors
> > > 
> > 
> > This happens because ARCH_RANDOM is disabled. May be I am wrong, but I
> > would argue that __arm64_rndr() should not be called directly in the
> > first place. arch_get_random_seed_long_early() should be called instead.
> 
> I am not sure about if that would cure possible ARCH_RANDOM=n compiling
> failures on all arches. Since my patch would not compile on mips etc, an
> alternative is to revert the buggy commit 585524081ecd for now. Any thought?
> 
It is quite unlikely that any other architecture would attempt to compile
any arm64 code (which is the only code touched by commit 585524081ecd).
Also, commit 585524081ecd fixes a different problem caused by the
recursive inclusion of asm/archrandom.h. On top of that, I think using
arch_get_random_seed_long_early() would be much cleaner than the current
code since it doesn't override/bypass ARCH_RANDOM.

Let's do it this way: I'll submit an alternate patch using
arch_get_random_seed_long_early(). This way Linus can decide how to
proceed, and we don't have to go back and forth.

Thanks,
Guenter

> > 
> > Thanks,
> > Guenter
> > 
> > > Fixes: 585524081ecd ("random: random.h should include archrandom.h, not the other way around")
> > > Signed-off-by: Qian Cai <cai@lca.pw>
> > > ---
> > >  include/linux/random.h | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/include/linux/random.h b/include/linux/random.h
> > > index f45b8be3e3c4..da782c16c20c 100644
> > > --- a/include/linux/random.h
> > > +++ b/include/linux/random.h
> > > @@ -12,6 +12,8 @@
> > >  #include <linux/list.h>
> > >  #include <linux/once.h>
> > >  
> > > +#include <asm/archrandom.h>
> > > +
> > >  #include <uapi/linux/random.h>
> > >  
> > >  struct random_ready_callback {
> > > 
> > 

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

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

end of thread, other threads:[~2020-08-07  0:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-06 13:58 [PATCH] random: fix a compilation error on arm64 Qian Cai
2020-08-06 13:58 ` Qian Cai
2020-08-06 14:50 ` Guenter Roeck
2020-08-06 14:50   ` Guenter Roeck
2020-08-06 22:43   ` Qian Cai
2020-08-06 22:43     ` Qian Cai
2020-08-07  0:19     ` Guenter Roeck
2020-08-07  0:19       ` Guenter Roeck
2020-08-06 22:01 ` kernel test robot
2020-08-06 22:01   ` kernel test robot
2020-08-06 22:01   ` kernel test robot
2020-08-06 22:25 ` kernel test robot
2020-08-06 22:25   ` kernel test robot
2020-08-06 22:25   ` kernel test robot

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.