On 23/10/2025 12.07, Harsh Prateek Bora wrote:
Hi Thomas,
I am seeing below CI failure with this patch:

In file included from ../target/ppc/cpu_init.c:46:
In function ‘register_BookE206_sprs’,
     inlined from ‘init_proc_e500’ at ../target/ppc/cpu_init.c:2910:5:
../target/ppc/spr_common.h:57:5: error: array subscript 3 is outside array bounds of ‘uint32_t[2]’ {aka ‘unsigned int[2]’} [-Werror=array-bounds=]
    57 |     _spr_register(env, num, name,              \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    58 |                   USR_ARG(uea_read) USR_ARG(uea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    59 |                   SYS_ARG(oea_read) SYS_ARG(oea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    60 |                   SYS_ARG(hea_read) SYS_ARG(hea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    61 |                   KVM_ARG(one_reg_id) initial_value)
       |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../target/ppc/spr_common.h:66:5: note: in expansion of macro ‘spr_register_kvm_hv’    66 |     spr_register_kvm_hv(env, num, name, uea_read, uea_write, oea_read,       \
       |     ^~~~~~~~~~~~~~~~~~~
../target/ppc/spr_common.h:77:5: note: in expansion of macro ‘spr_register_kvm’
   77 |     spr_register_kvm(env, num, name, uea_read, uea_write,              \
       |     ^~~~~~~~~~~~~~~~
../target/ppc/cpu_init.c:894:9: note: in expansion of macro ‘spr_register’
   894 |         spr_register(env, SPR_BOOKE_TLB3CFG, "TLB3CFG",
       |         ^~~~~~~~~~~~
../target/ppc/cpu_init.c: In function ‘init_proc_e500’:
../target/ppc/cpu_init.c:2809:14: note: at offset 12 into object ‘tlbncfg’ of size 8
  2809 |     uint32_t tlbncfg[2];
       |              ^~~~~~~
In function ‘register_BookE206_sprs’,
     inlined from ‘init_proc_e500’ at ../target/ppc/cpu_init.c:2910:5:
../target/ppc/spr_common.h:57:5: error: array subscript 2 is outside array bounds of ‘uint32_t[2]’ {aka ‘unsigned int[2]’} [-Werror=array-bounds=]
    57 |     _spr_register(env, num, name,              \
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    58 |                   USR_ARG(uea_read) USR_ARG(uea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    59 |                   SYS_ARG(oea_read) SYS_ARG(oea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    60 |                   SYS_ARG(hea_read) SYS_ARG(hea_write)              \
       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    61 |                   KVM_ARG(one_reg_id) initial_value)
       |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../target/ppc/spr_common.h:66:5: note: in expansion of macro ‘spr_register_kvm_hv’    66 |     spr_register_kvm_hv(env, num, name, uea_read, uea_write, oea_read,       \
       |     ^~~~~~~~~~~~~~~~~~~
../target/ppc/spr_common.h:77:5: note: in expansion of macro ‘spr_register_kvm’
   77 |     spr_register_kvm(env, num, name, uea_read, uea_write,              \
       |     ^~~~~~~~~~~~~~~~
../target/ppc/cpu_init.c:900:9: note: in expansion of macro ‘spr_register’
   900 |         spr_register(env, SPR_BOOKE_TLB2CFG, "TLB2CFG",
       |         ^~~~~~~~~~~~
../target/ppc/cpu_init.c: In function ‘init_proc_e500’:
../target/ppc/cpu_init.c:2809:14: note: at offset 8 into object ‘tlbncfg’ of size 8
  2809 |     uint32_t tlbncfg[2];
       |              ^~~~~~~
cc1: all warnings being treated as errors
[1374/1838] Compiling C object libqemu-ppc-softmmu.a.p/target_ppc_gdbstub.c.o
[1375/1838] Compiling C object libqemu-ppc-softmmu.a.p/target_ppc_cpu- models.c.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:168: run-ninja] Error 1
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 1

Kindly take a look.

Drat, I think I likely only tested it in a build folder where I had run configure with --disable-werror earlier, that's why I didn't notice. Sorry for that. I'll try to come up with a fix and send a v2 when it's ready.

 Thomas


Reply via email to