Re: [PATCH v2 8/9] riscv: introduce interfaces to patch kernel code

kbuild test robot
2020-03-09T12:50:41Z

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

Hi Zong,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v5.6-rc5]
[also build test WARNING on next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Zong-Li/Support-strict-kernel-memory-permissions-for-security/20200309-172554
base: 2c523b344dfa65a3738e7039832044aa133c75fb
config: riscv-allnoconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
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
GCC_VERSION=7.5.0 make.cross ARCH=riscv

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

All warnings (new ones prefixed by >>):

In file included from include/linux/spinlock.h:318:0,
from arch/riscv/kernel/patch.c:6:
arch/riscv/kernel/patch.c: In function 'riscv_insn_write':
arch/riscv/kernel/patch.c:63:25: error: 'patch_lock' undeclared (first use in this function); did you mean 'patch_map'?
raw_spin_lock_irqsave(&patch_lock, flags);
^
include/linux/spinlock_api_up.h:28:32: note: in definition of macro '___LOCK'
do { __acquire(lock); (void)(lock); } while (0)
^~~~
>> include/linux/spinlock_api_up.h:40:31: note: in expansion of macro '__LOCK'
do { local_irq_save(flags); __LOCK(lock); } while (0)
^~~~~~
>> include/linux/spinlock_api_up.h:68:45: note: in expansion of macro '__LOCK_IRQSAVE'
#define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
^~~~~~~~~~~~~~
>> include/linux/spinlock.h:272:3: note: in expansion of macro '_raw_spin_lock_irqsave'
_raw_spin_lock_irqsave(lock, flags); \
^~~~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/patch.c:63:2: note: in expansion of macro 'raw_spin_lock_irqsave'
raw_spin_lock_irqsave(&patch_lock, flags);
^~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/patch.c:63:25: note: each undeclared identifier is reported only once for each function it appears in
raw_spin_lock_irqsave(&patch_lock, flags);
^
include/linux/spinlock_api_up.h:28:32: note: in definition of macro '___LOCK'
do { __acquire(lock); (void)(lock); } while (0)
^~~~
>> include/linux/spinlock_api_up.h:40:31: note: in expansion of macro '__LOCK'
do { local_irq_save(flags); __LOCK(lock); } while (0)
^~~~~~
>> include/linux/spinlock_api_up.h:68:45: note: in expansion of macro '__LOCK_IRQSAVE'
#define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
^~~~~~~~~~~~~~
>> include/linux/spinlock.h:272:3: note: in expansion of macro '_raw_spin_lock_irqsave'
_raw_spin_lock_irqsave(lock, flags); \
^~~~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/patch.c:63:2: note: in expansion of macro 'raw_spin_lock_irqsave'
raw_spin_lock_irqsave(&patch_lock, flags);
^~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/patch.c:66:25: error: 'FIX_TEXT_POKE1' undeclared (first use in this function)
patch_map(addr + len, FIX_TEXT_POKE1);
^~~~~~~~~~~~~~
arch/riscv/kernel/patch.c:68:26: error: 'FIX_TEXT_POKE0' undeclared (first use in this function); did you mean 'FIX_TEXT_POKE1'?
waddr = patch_map(addr, FIX_TEXT_POKE0);
^~~~~~~~~~~~~~
FIX_TEXT_POKE1
--
In file included from include/linux/spinlock.h:318:0,
from arch/riscv//kernel/patch.c:6:
arch/riscv//kernel/patch.c: In function 'riscv_insn_write':
arch/riscv//kernel/patch.c:63:25: error: 'patch_lock' undeclared (first use in this function); did you mean 'patch_map'?
raw_spin_lock_irqsave(&patch_lock, flags);
^
include/linux/spinlock_api_up.h:28:32: note: in definition of macro '___LOCK'
do { __acquire(lock); (void)(lock); } while (0)
^~~~
>> include/linux/spinlock_api_up.h:40:31: note: in expansion of macro '__LOCK'
do { local_irq_save(flags); __LOCK(lock); } while (0)
^~~~~~
>> include/linux/spinlock_api_up.h:68:45: note: in expansion of macro '__LOCK_IRQSAVE'
#define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
^~~~~~~~~~~~~~
>> include/linux/spinlock.h:272:3: note: in expansion of macro '_raw_spin_lock_irqsave'
_raw_spin_lock_irqsave(lock, flags); \
^~~~~~~~~~~~~~~~~~~~~~
arch/riscv//kernel/patch.c:63:2: note: in expansion of macro 'raw_spin_lock_irqsave'
raw_spin_lock_irqsave(&patch_lock, flags);
^~~~~~~~~~~~~~~~~~~~~
arch/riscv//kernel/patch.c:63:25: note: each undeclared identifier is reported only once for each function it appears in
raw_spin_lock_irqsave(&patch_lock, flags);
^
include/linux/spinlock_api_up.h:28:32: note: in definition of macro '___LOCK'
do { __acquire(lock); (void)(lock); } while (0)
^~~~
>> include/linux/spinlock_api_up.h:40:31: note: in expansion of macro '__LOCK'
do { local_irq_save(flags); __LOCK(lock); } while (0)
^~~~~~
>> include/linux/spinlock_api_up.h:68:45: note: in expansion of macro '__LOCK_IRQSAVE'
#define _raw_spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
^~~~~~~~~~~~~~
>> include/linux/spinlock.h:272:3: note: in expansion of macro '_raw_spin_lock_irqsave'
_raw_spin_lock_irqsave(lock, flags); \
^~~~~~~~~~~~~~~~~~~~~~
arch/riscv//kernel/patch.c:63:2: note: in expansion of macro 'raw_spin_lock_irqsave'
raw_spin_lock_irqsave(&patch_lock, flags);
^~~~~~~~~~~~~~~~~~~~~
arch/riscv//kernel/patch.c:66:25: error: 'FIX_TEXT_POKE1' undeclared (first use in this function)
patch_map(addr + len, FIX_TEXT_POKE1);
^~~~~~~~~~~~~~
arch/riscv//kernel/patch.c:68:26: error: 'FIX_TEXT_POKE0' undeclared (first use in this function); did you mean 'FIX_TEXT_POKE1'?
waddr = patch_map(addr, FIX_TEXT_POKE0);
^~~~~~~~~~~~~~
FIX_TEXT_POKE1

vim +/_raw_spin_lock_irqsave +272 include/linux/spinlock.h

b8e6ec865fd1d8 Linus Torvalds 2006-11-26 268
c2f21ce2e31286 Thomas Gleixner 2009-12-02 269 #define raw_spin_lock_irqsave(lock, flags) \
3f307891ce0e7b Steven Rostedt 2008-07-25 270 do { \
3f307891ce0e7b Steven Rostedt 2008-07-25 271 typecheck(unsigned long, flags); \
9c1721aa4994f6 Thomas Gleixner 2009-12-03 @272 _raw_spin_lock_irqsave(lock, flags); \
3f307891ce0e7b Steven Rostedt 2008-07-25 273 } while (0)
ef12f10994281e Thomas Gleixner 2009-11-07 274

:::::: The code at line 272 was first introduced by commit
:::::: 9c1721aa4994f6625decbd915241f3a94ee2fe67 locking: Cleanup the name space completely

:::::: TO: Thomas Gleixner <tglx@linutronix.de>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>

---
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: 5366 bytes --]