From patchwork Tue Feb 13 04:52:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 872609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="uuY5hAjl"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zgVX46PjXz9t3F for ; Tue, 13 Feb 2018 15:52:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933406AbeBMEwf (ORCPT ); Mon, 12 Feb 2018 23:52:35 -0500 Received: from ozlabs.org ([103.22.144.67]:43491 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933025AbeBMEwe (ORCPT ); Mon, 12 Feb 2018 23:52:34 -0500 Received: by ozlabs.org (Postfix, from userid 1003) id 3zgVX05Jvwz9sP9; Tue, 13 Feb 2018 15:52:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1518497552; bh=2kulitxq9wfixW37tucK6MUEKyyPCQ/kkGNzQqxc9lk=; h=Date:From:To:Cc:Subject:From; b=uuY5hAjlHUptxB1VBWOgRHst2aO9qb7z17Y9yZ1I30XowLNUZzD7kgQzNIcElGNfm 3LHPjN3N38pM9PW+dQv/YvVfB0lqWDr8PtgOsN/Sd9Ab7MvghHPf9f3LELvMd1HmGb pG7IDA+/2ixno+9SoJWQkvpuMmVwOLFzQAp6fQfJaJYrfy/SNUIlpnNy94ZJCy9tdi ASRucFyDx4ts7a50yBPR4gNG8odbsfNh+I5MsI2ffEw6FoFP05zDeUI8yVkhTbPyPU kemwSdTqDEUOxMB05EYla5EHc8IoOS1eJKKcN+v3Vpa7ZSzI/pB2ogQdltjozX1L1z pwXRZ7mO2LLCw== Date: Tue, 13 Feb 2018 15:52:30 +1100 From: Paul Mackerras To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: Michael Ellerman Subject: [PATCH 2/2] KVM: PPC: Book3S: Fix compile error that occurs with some gcc versions Message-ID: <20180213045230.bsdqcgqo3vsfny7a@oak.ozlabs.ibm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org 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 Signed-off-by: Paul Mackerras --- 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,