tree: https://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux.git kgdb/for-next head: 2277b492582d5525244519f60da6f9daea5ef41a commit: 2277b492582d5525244519f60da6f9daea5ef41a [4/4] kdb: Fix stack crawling on 'running' CPUs that aren't the master config: sh-allyesconfig (attached as .config) compiler: sh4-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 git checkout 2277b492582d5525244519f60da6f9daea5ef41a # save the attached .config to linux build tree GCC_VERSION=7.4.0 make.cross ARCH=sh If you fix the issue, kindly add following tag Reported-by: kbuild test robot Note: it may well be a FALSE warning. FWIW you are at least aware of it now. All warnings (new ones prefixed by >>): kernel/debug/debug_core.c: In function 'kdb_dump_stack_on_cpu': >> kernel/debug/debug_core.c:452:17: warning: array subscript is outside array bounds [-Warray-bounds] if (!(kgdb_info[cpu].exception_state & DCPU_IS_SLAVE)) { ~~~~~~~~~^~~~~ kernel/debug/debug_core.c:469:33: warning: array subscript is outside array bounds [-Warray-bounds] kgdb_info[cpu].exception_state |= DCPU_WANT_BT; kernel/debug/debug_core.c:470:18: warning: array subscript is outside array bounds [-Warray-bounds] while (kgdb_info[cpu].exception_state & DCPU_WANT_BT) ~~~~~~~~~^~~~~ vim +452 kernel/debug/debug_core.c 443 444 #ifdef CONFIG_KGDB_KDB 445 void kdb_dump_stack_on_cpu(int cpu) 446 { 447 if (cpu == raw_smp_processor_id()) { 448 dump_stack(); 449 return; 450 } 451 > 452 if (!(kgdb_info[cpu].exception_state & DCPU_IS_SLAVE)) { 453 kdb_printf("ERROR: Task on cpu %d didn't stop in the debugger\n", 454 cpu); 455 return; 456 } 457 458 /* 459 * In general, architectures don't support dumping the stack of a 460 * "running" process that's not the current one. From the point of 461 * view of the Linux, kernel processes that are looping in the kgdb 462 * slave loop are still "running". There's also no API (that actually 463 * works across all architectures) that can do a stack crawl based 464 * on registers passed as a parameter. 465 * 466 * Solve this conundrum by asking slave CPUs to do the backtrace 467 * themselves. 468 */ 469 kgdb_info[cpu].exception_state |= DCPU_WANT_BT; 470 while (kgdb_info[cpu].exception_state & DCPU_WANT_BT) 471 cpu_relax(); 472 } 473 #endif 474 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation