[gustavoars:testing/WFAMNAE-next20240621-CbC 1/11] arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure

From: kernel test robot
Date: Fri Jul 12 2024 - 00:20:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git testing/WFAMNAE-next20240621-CbC
head: 30867ef8ad076c11ed274d76f99e8bb0346790af
commit: 18c8dad6dac24de88b5379ad4e367e50d06a96ec [1/11] Makefile: Enable -Wflex-array-member-not-at-end globally
:::::: branch date: 5 hours ago
:::::: commit date: 2 weeks ago
config: powerpc-allnoconfig (https://download.01.org/0day-ci/archive/20240711/202407111827.iLqomSUr-lkp@xxxxxxxxx/config)
compiler: powerpc-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240711/202407111827.iLqomSUr-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202407111827.iLqomSUr-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from arch/powerpc/include/asm/kvm_host.h:26,
from include/linux/kvm_host.h:45,
from arch/powerpc/include/asm/kvm_ppc.h:19,
from arch/powerpc/include/asm/dbell.h:17,
from arch/powerpc/kernel/asm-offsets.c:36:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
include/linux/kvm_host.h:1838:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
1838 | struct kvm_stats_desc desc;
| ^~~~
--
In file included from include/linux/security.h:35,
from include/linux/perf_event.h:62,
from include/linux/trace_events.h:10,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:94,
from arch/powerpc/kernel/signal_32.c:26:
include/linux/bpf.h:2002:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
2002 | struct bpf_prog_array hdr;
| ^~~
In file included from include/linux/tty_port.h:8,
from include/linux/tty.h:11,
from arch/powerpc/kernel/signal_32.c:33:
include/linux/tty_buffer.h:40:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
40 | struct tty_buffer sentinel;
| ^~~~~~~~
In file included from arch/powerpc/include/asm/ultravisor-api.h:11,
from arch/powerpc/include/asm/asm-prototypes.h:19,
from arch/powerpc/kernel/signal_32.c:44:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
--
In file included from include/linux/security.h:35,
from include/linux/perf_event.h:62,
from include/linux/hw_breakpoint.h:5,
from arch/powerpc/kernel/process.c:37:
include/linux/bpf.h:2002:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
2002 | struct bpf_prog_array hdr;
| ^~~
In file included from arch/powerpc/include/asm/ultravisor-api.h:11,
from arch/powerpc/include/asm/asm-prototypes.h:19,
from arch/powerpc/kernel/process.c:61:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
--
In file included from arch/powerpc/kernel/sysfs.c:17:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
--
In file included from include/linux/tty_port.h:8,
from include/linux/tty.h:11,
from arch/powerpc/kernel/setup_32.c:14:
include/linux/tty_buffer.h:40:27: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
40 | struct tty_buffer sentinel;
| ^~~~~~~~
In file included from arch/powerpc/include/asm/ultravisor-api.h:11,
from arch/powerpc/include/asm/asm-prototypes.h:19,
from arch/powerpc/kernel/setup_32.c:45:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
--
In file included from arch/powerpc/include/asm/kvm_host.h:26,
from include/linux/kvm_host.h:45,
from arch/powerpc/include/asm/kvm_ppc.h:19,
from arch/powerpc/include/asm/dbell.h:17,
from arch/powerpc/kernel/asm-offsets.c:36:
>> arch/powerpc/include/asm/hvcall.h:697:48: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
697 | struct hv_get_perf_counter_info_params params;
| ^~~~~~
include/linux/kvm_host.h:1838:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
1838 | struct kvm_stats_desc desc;
| ^~~~


vim +697 arch/powerpc/include/asm/hvcall.h

59562b5c33d6ff Scott Cheloha 2020-07-27 691
59562b5c33d6ff Scott Cheloha 2020-07-27 692 #define HGPCI_REQ_BUFFER_SIZE 4096
59562b5c33d6ff Scott Cheloha 2020-07-27 693 #define HGPCI_MAX_DATA_BYTES \
59562b5c33d6ff Scott Cheloha 2020-07-27 694 (HGPCI_REQ_BUFFER_SIZE - sizeof(struct hv_get_perf_counter_info_params))
59562b5c33d6ff Scott Cheloha 2020-07-27 695
59562b5c33d6ff Scott Cheloha 2020-07-27 696 struct hv_gpci_request_buffer {
59562b5c33d6ff Scott Cheloha 2020-07-27 @697 struct hv_get_perf_counter_info_params params;
59562b5c33d6ff Scott Cheloha 2020-07-27 698 uint8_t bytes[HGPCI_MAX_DATA_BYTES];
59562b5c33d6ff Scott Cheloha 2020-07-27 699 } __packed;
59562b5c33d6ff Scott Cheloha 2020-07-27 700

:::::: The code at line 697 was first introduced by commit
:::::: 59562b5c33d6ff3685509ed58b2ed3c5b5712704 powerpc/perf: consolidate GPCI hcall structs into asm/hvcall.h

:::::: TO: Scott Cheloha <cheloha@xxxxxxxxxxxxx>
:::::: CC: Michael Ellerman <mpe@xxxxxxxxxxxxxx>

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