* [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp'
@ 2020-05-19 17:51 kbuild test robot
2020-05-19 20:55 ` Borislav Petkov
0 siblings, 1 reply; 10+ messages in thread
From: kbuild test robot @ 2020-05-19 17:51 UTC (permalink / raw)
To: Christoph Hellwig
Cc: kbuild-all, clang-built-linux, linux-kernel, x86, Borislav Petkov
[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm
head: bd1de2a7aace4d1d312fb1be264b8fafdb706208
commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add a x86_has_pat_wp() helper
config: x86_64-randconfig-r012-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' [-Wmissing-prototypes]
bool x86_has_pat_wp(void)
^
arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool x86_has_pat_wp(void)
^
static
arch/x86/mm/init.c:866:13: warning: no previous prototype for function 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes]
void __weak mem_encrypt_free_decrypted_mem(void) { }
^
arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __weak mem_encrypt_free_decrypted_mem(void) { }
^
static
2 warnings generated.
vim +/x86_has_pat_wp +75 arch/x86/mm/init.c
73
74 /* Check that the write-protect PAT entry is set for write-protect */
> 75 bool x86_has_pat_wp(void)
76 {
77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == _PAGE_CACHE_MODE_WP;
78 }
79
---
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: 31116 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-19 17:51 [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' kbuild test robot @ 2020-05-19 20:55 ` Borislav Petkov 2020-05-19 21:25 ` Nathan Chancellor 0 siblings, 1 reply; 10+ messages in thread From: Borislav Petkov @ 2020-05-19 20:55 UTC (permalink / raw) To: kbuild test robot Cc: Christoph Hellwig, kbuild-all, clang-built-linux, linux-kernel, x86, Benjamin Thiel On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add a x86_has_pat_wp() helper > config: x86_64-randconfig-r012-20200519 (attached as .config) > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install x86_64 cross compiling tool for clang build > # apt-get install binutils-x86-64-linux-gnu > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kbuild test robot <lkp@intel.com> > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' [-Wmissing-prototypes] > bool x86_has_pat_wp(void) > ^ Triggers with gcc too: make W=1 arch/x86/mm/init.o ... arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ [-Wmissing-prototypes] 81 | bool x86_has_pat_wp(void) | ^~~~~~~~~~~~~~ -Wmissing-prototypes is default off, though, dunno why clang 11 has it on. Anyway, something for Benni to fix. CCed and leaving the rest for him as reference. > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > bool x86_has_pat_wp(void) > ^ > static > arch/x86/mm/init.c:866:13: warning: no previous prototype for function 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > void __weak mem_encrypt_free_decrypted_mem(void) { } > ^ > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > void __weak mem_encrypt_free_decrypted_mem(void) { } > ^ > static > 2 warnings generated. > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > 73 > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > 75 bool x86_has_pat_wp(void) > 76 { > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == _PAGE_CACHE_MODE_WP; > 78 } > 79 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-19 20:55 ` Borislav Petkov @ 2020-05-19 21:25 ` Nathan Chancellor 2020-05-19 22:12 ` Nick Desaulniers 0 siblings, 1 reply; 10+ messages in thread From: Nathan Chancellor @ 2020-05-19 21:25 UTC (permalink / raw) To: Borislav Petkov Cc: kbuild test robot, Christoph Hellwig, kbuild-all, clang-built-linux, linux-kernel, x86, Benjamin Thiel On Tue, May 19, 2020 at 10:55:05PM +0200, Borislav Petkov wrote: > On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add a x86_has_pat_wp() helper > > config: x86_64-randconfig-r012-20200519 (attached as .config) > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > > reproduce: > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # install x86_64 cross compiling tool for clang build > > # apt-get install binutils-x86-64-linux-gnu > > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > > # save the attached .config to linux build tree > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kbuild test robot <lkp@intel.com> > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' [-Wmissing-prototypes] > > bool x86_has_pat_wp(void) > > ^ > > Triggers with gcc too: > > make W=1 arch/x86/mm/init.o > > ... > > arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ [-Wmissing-prototypes] > 81 | bool x86_has_pat_wp(void) > | ^~~~~~~~~~~~~~ > > > -Wmissing-prototypes is default off, though, dunno why clang 11 has it > on. It doesn't: https://godbolt.org/z/rU5_5H I assume this is caused by some sort of internal change to the 0day infrastructure (testing W=1?) I cannot see this without adding W=1 to make at the listed commit with the provided config. Cheers, Nathan > Anyway, something for Benni to fix. CCed and leaving the rest for him as > reference. > > > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > > bool x86_has_pat_wp(void) > > ^ > > static > > arch/x86/mm/init.c:866:13: warning: no previous prototype for function 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > ^ > > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > ^ > > static > > 2 warnings generated. > > > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > > > 73 > > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > > 75 bool x86_has_pat_wp(void) > > 76 { > > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == _PAGE_CACHE_MODE_WP; > > 78 } > > 79 > > > > --- > > 0-DAY CI Kernel Test Service, Intel Corporation > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-19 21:25 ` Nathan Chancellor @ 2020-05-19 22:12 ` Nick Desaulniers 2020-05-19 23:49 ` Li, Philip 0 siblings, 1 reply; 10+ messages in thread From: Nick Desaulniers @ 2020-05-19 22:12 UTC (permalink / raw) To: Masahiro Yamada, Philip Li Cc: Borislav Petkov, kbuild test robot, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor Masahiro and Philip, We're seeing a bunch of -Wmissing-prototypes warnings from 0day bot suddenly today. Did something change on the Kbuild or 0day bot side? On Tue, May 19, 2020 at 2:25 PM Nathan Chancellor <natechancellor@gmail.com> wrote: > > On Tue, May 19, 2020 at 10:55:05PM +0200, Borislav Petkov wrote: > > On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > > > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > > > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add a x86_has_pat_wp() helper > > > config: x86_64-randconfig-r012-20200519 (attached as .config) > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > > > reproduce: > > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > > chmod +x ~/bin/make.cross > > > # install x86_64 cross compiling tool for clang build > > > # apt-get install binutils-x86-64-linux-gnu > > > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > > > # save the attached .config to linux build tree > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 > > > > > > If you fix the issue, kindly add following tag as appropriate > > > Reported-by: kbuild test robot <lkp@intel.com> > > > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' [-Wmissing-prototypes] > > > bool x86_has_pat_wp(void) > > > ^ > > > > Triggers with gcc too: > > > > make W=1 arch/x86/mm/init.o > > > > ... > > > > arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ [-Wmissing-prototypes] > > 81 | bool x86_has_pat_wp(void) > > | ^~~~~~~~~~~~~~ > > > > > > -Wmissing-prototypes is default off, though, dunno why clang 11 has it > > on. > > It doesn't: https://godbolt.org/z/rU5_5H > > I assume this is caused by some sort of internal change to the 0day > infrastructure (testing W=1?) > > I cannot see this without adding W=1 to make at the listed commit with > the provided config. > > Cheers, > Nathan > > > Anyway, something for Benni to fix. CCed and leaving the rest for him as > > reference. > > > > > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > > > bool x86_has_pat_wp(void) > > > ^ > > > static > > > arch/x86/mm/init.c:866:13: warning: no previous prototype for function 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > ^ > > > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended to be used outside of this translation unit > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > ^ > > > static > > > 2 warnings generated. > > > > > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > > > > > 73 > > > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > > > 75 bool x86_has_pat_wp(void) > > > 76 { > > > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == _PAGE_CACHE_MODE_WP; > > > 78 } > > > 79 > > > > > > --- > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > > > > -- > > Regards/Gruss, > > Boris. > > > > https://people.kernel.org/tglx/notes-about-netiquette > > > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200519212541.GA3580016%40ubuntu-s3-xlarge-x86. -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-19 22:12 ` Nick Desaulniers @ 2020-05-19 23:49 ` Li, Philip 2020-05-20 0:26 ` Nick Desaulniers 0 siblings, 1 reply; 10+ messages in thread From: Li, Philip @ 2020-05-19 23:49 UTC (permalink / raw) To: Nick Desaulniers, Masahiro Yamada Cc: Borislav Petkov, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor > Subject: Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous > prototype for function 'x86_has_pat_wp' > > Masahiro and Philip, > We're seeing a bunch of -Wmissing-prototypes warnings from 0day bot > suddenly today. Did something change on the Kbuild or 0day bot side? Hi Nick, W=1 was added to make. This leads to extra warnings. > > On Tue, May 19, 2020 at 2:25 PM Nathan Chancellor > <natechancellor@gmail.com> wrote: > > > > On Tue, May 19, 2020 at 10:55:05PM +0200, Borislav Petkov wrote: > > > On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > > > > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > > > > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add > a x86_has_pat_wp() helper > > > > config: x86_64-randconfig-r012-20200519 (attached as .config) > > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project > 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > > > > reproduce: > > > > wget https://raw.githubusercontent.com/intel/lkp- > tests/master/sbin/make.cross -O ~/bin/make.cross > > > > chmod +x ~/bin/make.cross > > > > # install x86_64 cross compiling tool for clang build > > > > # apt-get install binutils-x86-64-linux-gnu > > > > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > > > > # save the attached .config to linux build tree > > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang > make.cross ARCH=x86_64 > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > Reported-by: kbuild test robot <lkp@intel.com> > > > > > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > > > > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function > 'x86_has_pat_wp' [-Wmissing-prototypes] > > > > bool x86_has_pat_wp(void) > > > > ^ > > > > > > Triggers with gcc too: > > > > > > make W=1 arch/x86/mm/init.o > > > > > > ... > > > > > > arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ > [-Wmissing-prototypes] > > > 81 | bool x86_has_pat_wp(void) > > > | ^~~~~~~~~~~~~~ > > > > > > > > > -Wmissing-prototypes is default off, though, dunno why clang 11 has it > > > on. > > > > It doesn't: https://godbolt.org/z/rU5_5H > > > > I assume this is caused by some sort of internal change to the 0day > > infrastructure (testing W=1?) > > > > I cannot see this without adding W=1 to make at the listed commit with > > the provided config. > > > > Cheers, > > Nathan > > > > > Anyway, something for Benni to fix. CCed and leaving the rest for him as > > > reference. > > > > > > > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended > to be used outside of this translation unit > > > > bool x86_has_pat_wp(void) > > > > ^ > > > > static > > > > arch/x86/mm/init.c:866:13: warning: no previous prototype for function > 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > ^ > > > > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended > to be used outside of this translation unit > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > ^ > > > > static > > > > 2 warnings generated. > > > > > > > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > > > > > > > 73 > > > > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > > > > 75 bool x86_has_pat_wp(void) > > > > 76 { > > > > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == > _PAGE_CACHE_MODE_WP; > > > > 78 } > > > > 79 > > > > > > > > --- > > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > > > > > > > > -- > > > Regards/Gruss, > > > Boris. > > > > > > https://people.kernel.org/tglx/notes-about-netiquette > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > "Clang Built Linux" group. > > To unsubscribe from this group and stop receiving emails from it, send an email > to clang-built-linux+unsubscribe@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/clang-built- > linux/20200519212541.GA3580016%40ubuntu-s3-xlarge-x86. > > > > -- > Thanks, > ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-19 23:49 ` Li, Philip @ 2020-05-20 0:26 ` Nick Desaulniers 2020-05-20 0:52 ` Philip Li 0 siblings, 1 reply; 10+ messages in thread From: Nick Desaulniers @ 2020-05-20 0:26 UTC (permalink / raw) To: Li, Philip Cc: Masahiro Yamada, Borislav Petkov, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor On Tue, May 19, 2020 at 4:49 PM Li, Philip <philip.li@intel.com> wrote: > > > Subject: Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous > > prototype for function 'x86_has_pat_wp' > > > > Masahiro and Philip, > > We're seeing a bunch of -Wmissing-prototypes warnings from 0day bot > > suddenly today. Did something change on the Kbuild or 0day bot side? > Hi Nick, W=1 was added to make. This leads to extra warnings. Ah, ok. Good to know the change is in 0day bot which rules out changes to Kbuild and Clang. It might be helpful to note in the email that this is a W=1 build, since it's non obvious and cannot be set via config. Generally, the kernel is not W=1 clean. I realize that 0day bot can filter old vs new. Why -Wmissing-prototypes is a problem is that: 1. there are already many instances of it throughout the kernel; references without forward declarations or correct includes. 2. it's easy for someone to call a function like code that already exists in the translation unit they're touching. So by adding another implicit call, they get warned for the whole file. Generally, the fix is trivial; just include the correct header. If that leads to tangly-sphagetti-limbo/circular includes, then raw forward declarations can be used (though it's easy for those to get out of sync, which can lead to spooky bugs). I think having in the top of the warning that this is a W=1 build will make it more obvious. I get that -Wmissing-prototypes can be noisy, but it's trivial to fix. I do worry what other warnings lurk in W=1 though... > > > > > On Tue, May 19, 2020 at 2:25 PM Nathan Chancellor > > <natechancellor@gmail.com> wrote: > > > > > > On Tue, May 19, 2020 at 10:55:05PM +0200, Borislav Petkov wrote: > > > > On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > > > > > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > > > > > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add > > a x86_has_pat_wp() helper > > > > > config: x86_64-randconfig-r012-20200519 (attached as .config) > > > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project > > 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > > > > > reproduce: > > > > > wget https://raw.githubusercontent.com/intel/lkp- > > tests/master/sbin/make.cross -O ~/bin/make.cross > > > > > chmod +x ~/bin/make.cross > > > > > # install x86_64 cross compiling tool for clang build > > > > > # apt-get install binutils-x86-64-linux-gnu > > > > > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > > > > > # save the attached .config to linux build tree > > > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang > > make.cross ARCH=x86_64 > > > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > > Reported-by: kbuild test robot <lkp@intel.com> > > > > > > > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > > > > > > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function > > 'x86_has_pat_wp' [-Wmissing-prototypes] > > > > > bool x86_has_pat_wp(void) > > > > > ^ > > > > > > > > Triggers with gcc too: > > > > > > > > make W=1 arch/x86/mm/init.o > > > > > > > > ... > > > > > > > > arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ > > [-Wmissing-prototypes] > > > > 81 | bool x86_has_pat_wp(void) > > > > | ^~~~~~~~~~~~~~ > > > > > > > > > > > > -Wmissing-prototypes is default off, though, dunno why clang 11 has it > > > > on. > > > > > > It doesn't: https://godbolt.org/z/rU5_5H > > > > > > I assume this is caused by some sort of internal change to the 0day > > > infrastructure (testing W=1?) > > > > > > I cannot see this without adding W=1 to make at the listed commit with > > > the provided config. > > > > > > Cheers, > > > Nathan > > > > > > > Anyway, something for Benni to fix. CCed and leaving the rest for him as > > > > reference. > > > > > > > > > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended > > to be used outside of this translation unit > > > > > bool x86_has_pat_wp(void) > > > > > ^ > > > > > static > > > > > arch/x86/mm/init.c:866:13: warning: no previous prototype for function > > 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > > ^ > > > > > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended > > to be used outside of this translation unit > > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > > ^ > > > > > static > > > > > 2 warnings generated. > > > > > > > > > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > > > > > > > > > 73 > > > > > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > > > > > 75 bool x86_has_pat_wp(void) > > > > > 76 { > > > > > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == > > _PAGE_CACHE_MODE_WP; > > > > > 78 } > > > > > 79 > > > > > > > > > > --- > > > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > > > > > > > > > > > > -- > > > > Regards/Gruss, > > > > Boris. > > > > > > > > https://people.kernel.org/tglx/notes-about-netiquette > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Clang Built Linux" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email > > to clang-built-linux+unsubscribe@googlegroups.com. > > > To view this discussion on the web visit > > https://groups.google.com/d/msgid/clang-built- > > linux/20200519212541.GA3580016%40ubuntu-s3-xlarge-x86. > > > > > > > > -- > > Thanks, > > ~Nick Desaulniers -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-20 0:26 ` Nick Desaulniers @ 2020-05-20 0:52 ` Philip Li 2020-05-20 1:07 ` Nick Desaulniers 0 siblings, 1 reply; 10+ messages in thread From: Philip Li @ 2020-05-20 0:52 UTC (permalink / raw) To: Nick Desaulniers Cc: Masahiro Yamada, Borislav Petkov, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor On Tue, May 19, 2020 at 05:26:18PM -0700, Nick Desaulniers wrote: > On Tue, May 19, 2020 at 4:49 PM Li, Philip <philip.li@intel.com> wrote: > > > > > Subject: Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous > > > prototype for function 'x86_has_pat_wp' > > > > > > Masahiro and Philip, > > > We're seeing a bunch of -Wmissing-prototypes warnings from 0day bot > > > suddenly today. Did something change on the Kbuild or 0day bot side? > > Hi Nick, W=1 was added to make. This leads to extra warnings. > > Ah, ok. Good to know the change is in 0day bot which rules out > changes to Kbuild and Clang. > > It might be helpful to note in the email that this is a W=1 build, > since it's non obvious and cannot be set via config. thanks for reminding this, we will update the report info to reflect this, e.g. part of reproduce step. > > Generally, the kernel is not W=1 clean. I realize that 0day bot can got it, we have logic to limit that not to report too old error, so the idea is to scan recent submitted patches. > filter old vs new. Why -Wmissing-prototypes is a problem is that: > 1. there are already many instances of it throughout the kernel; > references without forward declarations or correct includes. > 2. it's easy for someone to call a function like code that already > exists in the translation unit they're touching. > > So by adding another implicit call, they get warned for the whole > file. Generally, the fix is trivial; just include the correct header. > If that leads to tangly-sphagetti-limbo/circular includes, then raw > forward declarations can be used (though it's easy for those to get > out of sync, which can lead to spooky bugs). > > I think having in the top of the warning that this is a W=1 build will > make it more obvious. > > I get that -Wmissing-prototypes can be noisy, but it's trivial to fix. > I do worry what other warnings lurk in W=1 though... with some monitoring, so far, issue like unused-but-set-variable is quite helpful. We will keep monitor for other issues and feedbacks. > > > > > > > > > On Tue, May 19, 2020 at 2:25 PM Nathan Chancellor > > > <natechancellor@gmail.com> wrote: > > > > > > > > On Tue, May 19, 2020 at 10:55:05PM +0200, Borislav Petkov wrote: > > > > > On Wed, May 20, 2020 at 01:51:25AM +0800, kbuild test robot wrote: > > > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/mm > > > > > > head: bd1de2a7aace4d1d312fb1be264b8fafdb706208 > > > > > > commit: 1f6f655e01adebf5bd5e6c3da2e843c104ded051 [1/23] x86/mm: Add > > > a x86_has_pat_wp() helper > > > > > > config: x86_64-randconfig-r012-20200519 (attached as .config) > > > > > > compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project > > > 135b877874fae96b4372c8a3fbfaa8ff44ff86e3) > > > > > > reproduce: > > > > > > wget https://raw.githubusercontent.com/intel/lkp- > > > tests/master/sbin/make.cross -O ~/bin/make.cross > > > > > > chmod +x ~/bin/make.cross > > > > > > # install x86_64 cross compiling tool for clang build > > > > > > # apt-get install binutils-x86-64-linux-gnu > > > > > > git checkout 1f6f655e01adebf5bd5e6c3da2e843c104ded051 > > > > > > # save the attached .config to linux build tree > > > > > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang > > > make.cross ARCH=x86_64 > > > > > > > > > > > > If you fix the issue, kindly add following tag as appropriate > > > > > > Reported-by: kbuild test robot <lkp@intel.com> > > > > > > > > > > > > All warnings (new ones prefixed by >>, old ones prefixed by <<): > > > > > > > > > > > > >> arch/x86/mm/init.c:75:6: warning: no previous prototype for function > > > 'x86_has_pat_wp' [-Wmissing-prototypes] > > > > > > bool x86_has_pat_wp(void) > > > > > > ^ > > > > > > > > > > Triggers with gcc too: > > > > > > > > > > make W=1 arch/x86/mm/init.o > > > > > > > > > > ... > > > > > > > > > > arch/x86/mm/init.c:81:6: warning: no previous prototype for ‘x86_has_pat_wp’ > > > [-Wmissing-prototypes] > > > > > 81 | bool x86_has_pat_wp(void) > > > > > | ^~~~~~~~~~~~~~ > > > > > > > > > > > > > > > -Wmissing-prototypes is default off, though, dunno why clang 11 has it > > > > > on. > > > > > > > > It doesn't: https://godbolt.org/z/rU5_5H > > > > > > > > I assume this is caused by some sort of internal change to the 0day > > > > infrastructure (testing W=1?) > > > > > > > > I cannot see this without adding W=1 to make at the listed commit with > > > > the provided config. > > > > > > > > Cheers, > > > > Nathan > > > > > > > > > Anyway, something for Benni to fix. CCed and leaving the rest for him as > > > > > reference. > > > > > > > > > > > arch/x86/mm/init.c:75:1: note: declare 'static' if the function is not intended > > > to be used outside of this translation unit > > > > > > bool x86_has_pat_wp(void) > > > > > > ^ > > > > > > static > > > > > > arch/x86/mm/init.c:866:13: warning: no previous prototype for function > > > 'mem_encrypt_free_decrypted_mem' [-Wmissing-prototypes] > > > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > > > ^ > > > > > > arch/x86/mm/init.c:866:1: note: declare 'static' if the function is not intended > > > to be used outside of this translation unit > > > > > > void __weak mem_encrypt_free_decrypted_mem(void) { } > > > > > > ^ > > > > > > static > > > > > > 2 warnings generated. > > > > > > > > > > > > vim +/x86_has_pat_wp +75 arch/x86/mm/init.c > > > > > > > > > > > > 73 > > > > > > 74 /* Check that the write-protect PAT entry is set for write-protect */ > > > > > > > 75 bool x86_has_pat_wp(void) > > > > > > 76 { > > > > > > 77 return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == > > > _PAGE_CACHE_MODE_WP; > > > > > > 78 } > > > > > > 79 > > > > > > > > > > > > --- > > > > > > 0-DAY CI Kernel Test Service, Intel Corporation > > > > > > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org > > > > > > > > > > > > > > > > > > > > -- > > > > > Regards/Gruss, > > > > > Boris. > > > > > > > > > > https://people.kernel.org/tglx/notes-about-netiquette > > > > > > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > "Clang Built Linux" group. > > > > To unsubscribe from this group and stop receiving emails from it, send an email > > > to clang-built-linux+unsubscribe@googlegroups.com. > > > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/clang-built- > > > linux/20200519212541.GA3580016%40ubuntu-s3-xlarge-x86. > > > > > > > > > > > > -- > > > Thanks, > > > ~Nick Desaulniers > > > > -- > Thanks, > ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-20 0:52 ` Philip Li @ 2020-05-20 1:07 ` Nick Desaulniers 2020-05-20 1:24 ` Philip Li 2020-05-20 17:19 ` Borislav Petkov 0 siblings, 2 replies; 10+ messages in thread From: Nick Desaulniers @ 2020-05-20 1:07 UTC (permalink / raw) To: Philip Li Cc: Masahiro Yamada, Borislav Petkov, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor On Tue, May 19, 2020 at 5:53 PM Philip Li <philip.li@intel.com> wrote: > > On Tue, May 19, 2020 at 05:26:18PM -0700, Nick Desaulniers wrote: > > I think having in the top of the warning that this is a W=1 build will > > make it more obvious. > > > > I get that -Wmissing-prototypes can be noisy, but it's trivial to fix. > > I do worry what other warnings lurk in W=1 though... > with some monitoring, so far, issue like unused-but-set-variable is quite > helpful. We will keep monitor for other issues and feedbacks. Hey, I'm always happy to see more warnings turned on. In our experience, we had to get a sense of how many instances of a newly enabled warning there are, and estimate how much time it would take to fix them all. It's further complicated by the fix going into different maintainers' trees and reaching mainline at different points in time, while regressions continue to sneak in until the warning is enabled. It may be time to consider "promoting" some warnings from W=1 to be on by default. But that takes careful manual review and estimation of the work involved. Turning on W=1 may be blasting people with a lot of new warnings, but if developers treat them with the same respect as the default enabled ones for Kbuild then I'm not complaining. -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-20 1:07 ` Nick Desaulniers @ 2020-05-20 1:24 ` Philip Li 2020-05-20 17:19 ` Borislav Petkov 1 sibling, 0 replies; 10+ messages in thread From: Philip Li @ 2020-05-20 1:24 UTC (permalink / raw) To: Nick Desaulniers Cc: Masahiro Yamada, Borislav Petkov, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor On Tue, May 19, 2020 at 06:07:14PM -0700, Nick Desaulniers wrote: > On Tue, May 19, 2020 at 5:53 PM Philip Li <philip.li@intel.com> wrote: > > > > On Tue, May 19, 2020 at 05:26:18PM -0700, Nick Desaulniers wrote: > > > I think having in the top of the warning that this is a W=1 build will > > > make it more obvious. > > > > > > I get that -Wmissing-prototypes can be noisy, but it's trivial to fix. > > > I do worry what other warnings lurk in W=1 though... > > with some monitoring, so far, issue like unused-but-set-variable is quite > > helpful. We will keep monitor for other issues and feedbacks. > > Hey, I'm always happy to see more warnings turned on. In our > experience, we had to get a sense of how many instances of a newly > enabled warning there are, and estimate how much time it would take to > fix them all. It's further complicated by the fix going into > different maintainers' trees and reaching mainline at different points > in time, while regressions continue to sneak in until the warning is > enabled. thanks and agree all the thinking here. For the 0-day ci side, we will be very careful, since the mechanism for us is to notify newly introduced problems from developer's patch, this can allow relatively min effort to solve the new problems. The other consideration is we test a lot of developer's tree and mailing list before they are upstream, we also hope such shift left testing can expose these warnings in new patches before maintainer's trees. Of course, there're extra reports due to W=1 against stable or mainline, while the number is small comparing to developer and mailing list part. > > It may be time to consider "promoting" some warnings from W=1 to be on > by default. But that takes careful manual review and estimation of > the work involved. Turning on W=1 may be blasting people with a lot > of new warnings, but if developers treat them with the same respect as > the default enabled ones for Kbuild then I'm not complaining. > -- > Thanks, > ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' 2020-05-20 1:07 ` Nick Desaulniers 2020-05-20 1:24 ` Philip Li @ 2020-05-20 17:19 ` Borislav Petkov 1 sibling, 0 replies; 10+ messages in thread From: Borislav Petkov @ 2020-05-20 17:19 UTC (permalink / raw) To: Nick Desaulniers Cc: Philip Li, Masahiro Yamada, lkp, Christoph Hellwig, kbuild-all, clang-built-linux, LKML, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Benjamin Thiel, Nathan Chancellor On Tue, May 19, 2020 at 06:07:14PM -0700, Nick Desaulniers wrote: > It may be time to consider "promoting" some warnings from W=1 to be on > by default. That's the end goal with -Wmissing-prototypes for arch/x86/ at least. We'll turn that on once all current warnings are fixed and won't allow any more patches with it. This is where the 0day bot would help with testing this but it really should say that it is a W=1 build and should tone down the message frequency as we're still very noisy. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-05-20 17:19 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-05-19 17:51 [tip:x86/mm 1/23] arch/x86/mm/init.c:75:6: warning: no previous prototype for function 'x86_has_pat_wp' kbuild test robot 2020-05-19 20:55 ` Borislav Petkov 2020-05-19 21:25 ` Nathan Chancellor 2020-05-19 22:12 ` Nick Desaulniers 2020-05-19 23:49 ` Li, Philip 2020-05-20 0:26 ` Nick Desaulniers 2020-05-20 0:52 ` Philip Li 2020-05-20 1:07 ` Nick Desaulniers 2020-05-20 1:24 ` Philip Li 2020-05-20 17:19 ` Borislav Petkov
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).