Re: [PATCH v0] RISC-V: Use Zkr to seed KASLR base address

From: kernel test robot
Date: Fri May 31 2024 - 14:57:04 EST


Hi Jesse,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.10-rc1 next-20240531]
[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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jesse-Taube/RISC-V-Use-Zkr-to-seed-KASLR-base-address/20240601-002545
base: linus/master
patch link: https://lore.kernel.org/r/20240531162327.2436962-1-jesse%40rivosinc.com
patch subject: [PATCH v0] RISC-V: Use Zkr to seed KASLR base address
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20240601/202406010241.HBpKhSuj-lkp@xxxxxxxxx/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project bafda89a0944d947fc4b3b5663185e07a397ac30)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240601/202406010241.HBpKhSuj-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406010241.HBpKhSuj-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from arch/riscv/kernel/pi/archrandom_early.c:13:
In file included from arch/riscv/include/asm/archrandom.h:13:
In file included from arch/riscv/include/asm/processor.h:71:
In file included from include/linux/cpumask.h:11:
In file included from include/linux/kernel.h:31:
>> include/linux/printk.h:619:9: warning: 'pr_err_once' macro redefined [-Wmacro-redefined]
619 | #define pr_err_once(fmt, ...) \
| ^
arch/riscv/kernel/pi/archrandom_early.c:9:9: note: previous definition is here
9 | #define pr_err_once(...)
| ^
>> arch/riscv/kernel/pi/archrandom_early.c:51:22: warning: variable 'tvec' is uninitialized when used here [-Wuninitialized]
51 | csr_write(CSR_TVEC, tvec);
| ^~~~
arch/riscv/include/asm/csr.h:506:38: note: expanded from macro 'csr_write'
506 | unsigned long __v = (unsigned long)(val); \
| ^~~
arch/riscv/kernel/pi/archrandom_early.c:44:20: note: initialize the variable 'tvec' to silence this warning
44 | unsigned long tvec;
| ^
| = 0
2 warnings generated.


vim +/pr_err_once +619 include/linux/printk.h

16cb839f1332497 Joe Perches 2011-01-12 612
16cb839f1332497 Joe Perches 2011-01-12 613 #define pr_emerg_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 614 printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 615 #define pr_alert_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 616 printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 617 #define pr_crit_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 618 printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 @619 #define pr_err_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 620 printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 621 #define pr_warn_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 622 printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 623 #define pr_notice_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 624 printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
16cb839f1332497 Joe Perches 2011-01-12 625 #define pr_info_once(fmt, ...) \
16cb839f1332497 Joe Perches 2011-01-12 626 printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
eb012d125a24197 Tetsuo Handa 2020-05-25 627 /* no pr_cont_once, don't do that... */
36d308d8b547ee1 Mikhail Gruzdev 2013-02-21 628

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki