[gustavoars:testing/fam01-next20230602 7/7] arch/sparc/kernel/irq_32.c:258:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]'

From: kernel test robot
Date: Sat Jun 03 2023 - 05:04:38 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/fam01-next20230602
head: 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
commit: 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8 [7/7] Makefile: Enable -Warray-bounds
config: sparc-randconfig-c043-20230531 (https://download.01.org/0day-ci/archive/20230603/202306031638.zmtz006C-lkp@xxxxxxxxx/config)
compiler: sparc-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/commit/?id=20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
git remote add gustavoars https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git
git fetch --no-tags gustavoars testing/fam01-next20230602
git checkout 20aaaa40b39f5178aee00e3982b68ab8fd0c59a8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=sparc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash arch/sparc/kernel/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306031638.zmtz006C-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

arch/sparc/kernel/irq_32.c: In function 'sparc_floppy_request_irq':
>> arch/sparc/kernel/irq_32.c:258:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:272:17: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
In file included from arch/sparc/kernel/irq_32.c:25:
arch/sparc/kernel/kernel.h:142:24: note: at offset [256, 1264] into object 'trapbase_cpu1' of size 16
142 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
In file included from arch/sparc/include/asm/traps.h:10,
from arch/sparc/kernel/kernel.h:8:
arch/sparc/kernel/irq_32.c:261:46: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:272:17: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:142:24: note: at offset [256, 1264] into object 'trapbase_cpu1' of size 16
142 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:272:17: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:142:24: note: at offset [256, 1264] into object 'trapbase_cpu1' of size 16
142 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:272:17: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:142:24: note: at offset [256, 1264] into object 'trapbase_cpu1' of size 16
142 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:272:17: note: in expansion of macro 'INSTANTIATE'
272 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:142:24: note: at offset [256, 1264] into object 'trapbase_cpu1' of size 16
142 | extern struct tt_entry trapbase_cpu1;
| ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:274:17: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:143:24: note: at offset [256, 1264] into object 'trapbase_cpu2' of size 16
143 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:261:46: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:274:17: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:143:24: note: at offset [256, 1264] into object 'trapbase_cpu2' of size 16
143 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:274:17: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:143:24: note: at offset [256, 1264] into object 'trapbase_cpu2' of size 16
143 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:274:17: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:143:24: note: at offset [256, 1264] into object 'trapbase_cpu2' of size 16
143 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:274:17: note: in expansion of macro 'INSTANTIATE'
274 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:143:24: note: at offset [256, 1264] into object 'trapbase_cpu2' of size 16
143 | extern struct tt_entry trapbase_cpu2;
| ^~~~~~~~~~~~~
>> arch/sparc/kernel/irq_32.c:258:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
258 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
| ^
arch/sparc/kernel/irq_32.c:276:17: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:144:24: note: at offset [256, 1264] into object 'trapbase_cpu3' of size 16
144 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:261:46: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
261 | (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/include/uapi/asm/traps.h:27:38: note: in definition of macro 'SPARC_BRANCH'
27 | (0x10800000 | (((dest_addr-inst_addr)>>2)&0x3fffff))
| ^~~~~~~~~
arch/sparc/kernel/irq_32.c:276:17: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:144:24: note: at offset [256, 1264] into object 'trapbase_cpu3' of size 16
144 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:259:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
259 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
| ^
arch/sparc/kernel/irq_32.c:276:17: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:144:24: note: at offset [256, 1264] into object 'trapbase_cpu3' of size 16
144 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:262:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
262 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
| ^
arch/sparc/kernel/irq_32.c:276:17: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:144:24: note: at offset [256, 1264] into object 'trapbase_cpu3' of size 16
144 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
arch/sparc/kernel/irq_32.c:263:14: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1]' [-Werror=array-bounds]
263 | table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
| ^
arch/sparc/kernel/irq_32.c:276:17: note: in expansion of macro 'INSTANTIATE'
276 | INSTANTIATE(trap_table)
| ^~~~~~~~~~~
arch/sparc/kernel/kernel.h:144:24: note: at offset [256, 1264] into object 'trapbase_cpu3' of size 16
144 | extern struct tt_entry trapbase_cpu3;
| ^~~~~~~~~~~~~
cc1: all warnings being treated as errors


vim +258 arch/sparc/kernel/irq_32.c

^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 240
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 241 int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler)
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 242 {
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 243 unsigned int cpu_irq;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 244 int err;
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 245
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 246
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 247 err = request_irq(irq, irq_handler, 0, "floppy", NULL);
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 248 if (err)
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 249 return -1;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 250
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 251 /* Save for later use in floppy interrupt handler */
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 252 floppy_irq = irq;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 253
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 254 cpu_irq = (irq & (NR_IRQS - 1));
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 255
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 256 /* Dork with trap table if we get this far. */
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 257 #define INSTANTIATE(table) \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 @258 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_one = SPARC_RD_PSR_L0; \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 259 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two = \
6baa9b20a68a88 arch/sparc/kernel/irq_32.c Sam Ravnborg 2011-04-18 260 SPARC_BRANCH((unsigned long) floppy_hardint, \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 261 (unsigned long) &table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_two);\
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 262 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_three = SPARC_RD_WIM_L3; \
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 263 table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 264
^1da177e4c3f41 arch/sparc/kernel/irq.c Linus Torvalds 2005-04-16 265 INSTANTIATE(sparc_ttable)
b08b5c9c9b35c9 arch/sparc/kernel/irq_32.c Sam Ravnborg 2012-05-25 266

:::::: The code at line 258 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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