Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 12:36:54 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:36 +0100
commitd1b70bf40b9d3efaed1f84d223f39f68bb199620 (patch)
treec5ed239da517ebea196d91318aab6eac3ccae5c4
parent28911b8a30903513b9921f22233d35fef2919e14 (diff)
KVM: PPC: Book3S: Fix compile error that occurs with some gcc
versions (bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch44
-rw-r--r--series.conf1
2 files changed, 45 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch b/patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch
new file mode 100644
index 0000000000..5b6d604ee4
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch
@@ -0,0 +1,44 @@
+From 6df3877fc962c2bb3d0438633dfd24a185af6838 Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+Date: Tue, 13 Feb 2018 15:45:21 +1100
+Subject: [PATCH] KVM: PPC: Book3S: Fix compile error that occurs with some gcc
+ versions
+
+References: bsc#1061840
+Patch-mainline: v4.16-rc5
+Git-commit: 6df3877fc962c2bb3d0438633dfd24a185af6838
+
+Some versions of gcc generate a warning that the variable "emulated"
+may be used uninitialized in function kvmppc_handle_load128_by2x64().
+It would be used uninitialized if kvmppc_handle_load128_by2x64 was
+ever called with vcpu->arch.mmio_vmx_copy_nums == 0, but neither of
+the callers ever do that, so there is no actual bug. When gcc
+generates a warning, it causes the build to fail because arch/powerpc
+is compiled with -Werror.
+
+This silences the warning by initializing "emulated" to EMULATE_DONE.
+
+Fixes: 09f984961c13 ("KVM: PPC: Book3S: Add MMIO emulation for VMX instructions")
+Reported-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kvm/powerpc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
+index 0083142c2f84..52c205373986 100644
+--- a/arch/powerpc/kvm/powerpc.c
++++ b/arch/powerpc/kvm/powerpc.c
+@@ -1345,7 +1345,7 @@ static int kvmppc_emulate_mmio_vsx_loadstore(struct kvm_vcpu *vcpu,
+ int kvmppc_handle_load128_by2x64(struct kvm_run *run, struct kvm_vcpu *vcpu,
+ unsigned int rt, int is_default_endian)
+ {
+- enum emulation_result emulated;
++ enum emulation_result emulated = EMULATE_DONE;
+
+ while (vcpu->arch.mmio_vmx_copy_nums) {
+ emulated = __kvmppc_handle_load(run, vcpu, rt, 8,
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index 99583a9ffe..b332cd0a65 100644
--- a/series.conf
+++ b/series.conf
@@ -13728,6 +13728,7 @@
patches.suse/Documentation-sphinx-Fix-Directive-import-error.patch
patches.arch/0001-arm64-mm-fix-thinko-in-non-global-page-table-attribu.patch
patches.arch/0001-arm64-Relax-ARM_SMCCC_ARCH_WORKAROUND_1-discovery.patch
+ patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch
patches.arch/KVM-PPC-Book3S-HV-Fix-guest-time-accounting-with-VIR.patch
patches.drivers/IB-mlx5-Fix-incorrect-size-of-klms-in-the-memory-reg.patch
patches.drivers/IB-mlx5-Avoid-passing-an-invalid-QP-type-to-firmware.patch