Summary: | sys-kernel/gentoo-sources-4.14.x / sys-kernel/ck-sources-4.14.x - arch/powerpc/kernel/kvm.c: In function `kvm_guest_init': ./arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: `in' may be used uninitialized in this function [-Werror=maybe-uninitialize | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michael 'veremitz' Everitt <gentoo> |
Component: | Current packages | Assignee: | Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gokturk, kuzetsa, ppc64, slyfox, toolchain |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | PPC64 | ||
OS: | Linux | ||
URL: | https://forums.gentoo.org/viewtopic-p-8268502.html?sid=b47ae262c34585d0ab6d6b1d340069f3#8268502 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 679558 | ||
Bug Blocks: | |||
Attachments: | .config |
In file included from ./arch/powerpc/include/uapi/asm/kvm_para.h:82:0, from ./arch/powerpc/include/asm/kvm_para.h:22, from ./include/uapi/linux/kvm_para.h:33, from ./include/linux/kvm_para.h:5, from ./include/linux/kvm_host.h:33, from arch/powerpc/kernel/kvm.c:22: arch/powerpc/kernel/kvm.c: In function ?kvm_guest_init?: ./arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: ?in? may be used uninitialized in this function [-Werror=maybe-uninitia$ ized] unsigned long register r3 asm("r3") = in[0]; ~~^~~ ./arch/powerpc/include/asm/epapr_hcalls.h:471:25: error: ?*((void *)&in+8)? may be used uninitialized in this function [-Werror=$ aybe-uninitialized] unsigned long register r4 asm("r4") = in[1]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:472:25: error: ?*((void *)&in+16)? may be used uninitialized in this function [-Werror$ maybe-uninitialized] unsigned long register r5 asm("r5") = in[2]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:473:25: error: ?*((void *)&in+24)? may be used uninitialized in this function [-Werror$ maybe-uninitialized] unsigned long register r6 asm("r6") = in[3]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:474:25: error: ?*((void *)&in+32)? may be used uninitialized in this function [-Werror$ maybe-uninitialized] unsigned long register r7 asm("r7") = in[4]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:475:25: error: ?*((void *)&in+40)? may be used uninitialized in this function [-Werror$ maybe-uninitialized] unsigned long register r8 asm("r8") = in[5]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:476:25: error: ?*((void *)&in+48)? may be used uninitialized in this function [-Werror= maybe-uninitialized] unsigned long register r9 asm("r9") = in[6]; ^~ ./arch/powerpc/include/asm/epapr_hcalls.h:477:25: error: ?*((void *)&in+56)? may be used uninitialized in this function [-Werror= maybe-uninitialized] unsigned long register r10 asm("r10") = in[7]; ^~~ cc1: all warnings being treated as errors make[1]: *** [scripts/Makefile.build:329: arch/powerpc/kernel/kvm.o] Error 1 make: *** [Makefile:1035: arch/powerpc/kernel] Error 2 Re-CC'ing toolchain per slyfox's original request. Adding ppc64 project for info. Reproduced build failure on vanilla linux-4.14. vanilla linux-master builds fine. Build command I used: $ cat mk.sh ARCH=powerpc \ CROSS_COMPILE=powerpc-unknown-linux-gnu- \ make -C ../linux,git \ O="$(pwd)" \ \ "$@" $ ./mk.sh -j9 arch/powerpc/kernel/kvm.o Bisected upstream fix down to a reasonable commit: 186b8f1587c79c2fa04bfa392fdf084443e398c1 is the first bad commit commit 186b8f1587c79c2fa04bfa392fdf084443e398c1 Author: Seth Forshee <seth.forshee@canonical.com> Date: Thu Sep 28 09:33:39 2017 -0400 powerpc: Always initialize input array when calling epapr_hypercall() Several callers to epapr_hypercall() pass an uninitialized stack allocated array for the input arguments, presumably because they have no input arguments. However this can produce errors like this one arch/powerpc/include/asm/epapr_hcalls.h:470:42: error: 'in' may be used uninitialized in this function [-Werror=maybe-uninitialized] unsigned long register r3 asm("r3") = in[0]; ~~^~~ Fix callers to this function to always zero-initialize the input arguments array to prevent this. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> :040000 040000 9707d8aa4afad3c40e7d48fd1dc048f21fe44626 212dbb76e660e5b26c5639c6acf32aca4ad58875 M arch Bisected as: $ git bisect start master v4.14 kernel@ please consider backportng https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=186b8f1587c79c2fa04bfa392fdf084443e398c1 to 4.14 branch to fix above build failure for kvm on ppc64. The following applies cleanly on vanilla v4.14 and fixes build: $ git cherry-pick 186b8f1587c79c2fa04bfa392fdf084443e398c1 The fix looks like a low-risk change. Backport for all LTS kernels requested, https://lore.kernel.org/stable/dc0ba1c6-89cb-90ff-f336-e7a5108f02ac@gentoo.org/ https://lists.adelielinux.org/hyperkitty/list/adelie-devel@lists.adelielinux.org/message/X7RHTLNQZ5E2M7QIN5UUACGR7ML7RUMC/ original Ack from upstream I see this has propagated to : 4.4.177 4.9.162 4.14.105 veremitz, I think we're ok here. Re-open if I am incorrect. |
Created attachment 560854 [details] .config See forum post for gentoo-sources-4.14.74 Also applies to ck-sources-4.14.x - config attached for 4.14.66-ck1.