Re: [PATCH 34/50] sparc: Add show_stack_loglvl()

From: kbuild test robot
Date: Fri Nov 08 2019 - 02:08:48 EST


Hi Dmitry,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.4-rc6 next-20191107]
[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/Dmitry-Safonov/kallsyms-printk-Add-loglvl-to-print_ip_sym/20191108-124037
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 847120f859cc45e074204f4cf33c8df069306eb2
config: sparc-defconfig (attached as .config)
compiler: sparc-linux-gcc (GCC) 7.4.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.4.0 make.cross ARCH=sparc

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

All errors (new ones prefixed by >>):

arch/sparc/kernel/process_32.c: In function 'show_stack_loglvl':
>> arch/sparc/kernel/process_32.c:160:7: error: 'tsk' undeclared (first use in this function); did you mean 'task'?
if (!tsk)
^~~
task
arch/sparc/kernel/process_32.c:160:7: note: each undeclared identifier is reported only once for each function it appears in
>> arch/sparc/kernel/process_32.c:163:25: error: '_ksp' undeclared (first use in this function); did you mean 'sp'?
if (tsk == current && !_ksp)
^~~~
sp

vim +160 arch/sparc/kernel/process_32.c

^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 146
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 147 /*
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 148 * The show_stack(), show_stack_loglvl() are external APIs which
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 149 * we do not use ourselves.
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 150 * The oops is printed in die_if_kernel.
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 151 */
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 152 void show_stack_loglvl(struct task_struct *task, unsigned long *sp,
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 153 const char *loglvl)
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 154 {
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 155 unsigned long pc, fp;
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 156 unsigned long task_base;
4d7b92ad572b4b arch/sparc/kernel/process_32.c Sam Ravnborg 2009-01-02 157 struct reg_window32 *rw;
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 158 int count = 0;
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 159
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 @160 if (!tsk)
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 161 tsk = current;
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 162
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 @163 if (tsk == current && !_ksp)
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 164 __asm__ __volatile__("mov %%fp, %0" : "=r" (_ksp));
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 165
89e3f23da9c827 arch/sparc/kernel/process_32.c Tejun Heo 2013-04-30 166 task_base = (unsigned long) task_stack_page(tsk);
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 167 fp = (unsigned long) _ksp;
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 168 do {
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 169 /* Bogus frame pointer? */
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 170 if (fp < (task_base + sizeof(struct thread_info)) ||
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 171 fp >= (task_base + (PAGE_SIZE << 1)))
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 172 break;
4d7b92ad572b4b arch/sparc/kernel/process_32.c Sam Ravnborg 2009-01-02 173 rw = (struct reg_window32 *) fp;
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 174 pc = rw->ins[7];
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 175 printk("%s[%08lx : ", loglvl, pc);
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 176 printk("%s%pS ] ", loglvl, (void *) pc);
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 177 fp = rw->ins[6];
^1da177e4c3f41 arch/sparc/kernel/process.c Linus Torvalds 2005-04-16 178 } while (++count < 16);
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 179 printk("%s\n", loglvl);
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 180 }
17ea0216681912 arch/sparc/kernel/process_32.c Dmitry Safonov 2019-11-06 181

:::::: The code at line 160 was first introduced by commit
:::::: 89e3f23da9c827bfa9806c3d4da83a12c1c8543a sparc32: make show_stack() acquire %fp if @_ksp is not specified

:::::: TO: Tejun Heo <tj@xxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip