Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: arm64: fix override-init warnings in W=1 builds

Add -Wno-override-init to the build flags for sys_regs.c,
handle_exit.c, and switch.c to fix warnings like the following:

arch/arm64/kvm/hyp/vhe/switch.c:271:43: warning: initialized field overwritten [-Woverride-init]
271 | [ESR_ELx_EC_CP15_32] = kvm_hyp_handle_cp15_32,
|

Signed-off-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240723101204.7356-2-sebott@redhat.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>

authored by

Sebastian Ott and committed by
Oliver Upton
963a08e5 32b9a52f

+7
+3
arch/arm64/kvm/Makefile
··· 10 10 obj-$(CONFIG_KVM) += kvm.o 11 11 obj-$(CONFIG_KVM) += hyp/ 12 12 13 + CFLAGS_sys_regs.o += -Wno-override-init 14 + CFLAGS_handle_exit.o += -Wno-override-init 15 + 13 16 kvm-y += arm.o mmu.o mmio.o psci.o hypercalls.o pvtime.o \ 14 17 inject_fault.o va_layout.o handle_exit.o \ 15 18 guest.o debug.o reset.o sys_regs.o stacktrace.o \
+2
arch/arm64/kvm/hyp/nvhe/Makefile
··· 20 20 lib-objs := clear_page.o copy_page.o memcpy.o memset.o 21 21 lib-objs := $(addprefix ../../../lib/, $(lib-objs)) 22 22 23 + CFLAGS_switch.nvhe.o += -Wno-override-init 24 + 23 25 hyp-obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \ 24 26 hyp-main.o hyp-smp.o psci-relay.o early_alloc.o page_alloc.o \ 25 27 cache.o setup.o mm.o mem_protect.o sys_regs.o pkvm.o stacktrace.o ffa.o
+2
arch/arm64/kvm/hyp/vhe/Makefile
··· 6 6 asflags-y := -D__KVM_VHE_HYPERVISOR__ 7 7 ccflags-y := -D__KVM_VHE_HYPERVISOR__ 8 8 9 + CFLAGS_switch.o += -Wno-override-init 10 + 9 11 obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o 10 12 obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \ 11 13 ../fpsimd.o ../hyp-entry.o ../exception.o