Received: by 2002:a17:90a:37a3:0:0:0:0 with SMTP id v32csp13115294pjb; Fri, 26 Jul 2019 05:33:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqQBHhxLs5t1Fl5Rm3jOKzZPR5ZjQnIfmUYEyNVb7S4/6r4shR+yqemYjLxSy6gXQ8lv3V X-Received: by 2002:aa7:957c:: with SMTP id x28mr21927232pfq.42.1564144392797; Fri, 26 Jul 2019 05:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564144392; cv=none; d=google.com; s=arc-20160816; b=HXXYn1A4yL6WX6fgahONaj6Rl95t3U6NpycW8ARC+ByH0ZJN5fAeT4aTWvwD7xqjF+ i0C1JbqCPfcRiBgk+nOeyxVkm3K5/cjKlX01RjBgnxQV1nvipmRzU1zINqtrZn9MmSS9 w0b+Tst7rWxmeaxtJNDrIJ9F5bmV10unPpHoWkpv7+zED8XICbO0c9/CeJ52AkYD3qrX F7pGCQ5rJVN78X9IVwJGSEI35GdT13VHYGxhm/FX5tXbF+1cjcsQ3Uz2Yek4JGuwNJ55 6ibVqHzxqoMU1y8fpIXeOX/Qf7nQSKW5QDwlCCl3ihW0/Fe1dhspxg2ZomI/Mvf9L4rV tbdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date; bh=yHJfzyiNoTOlhMtVsoUNwTUd63D43PT6EPwU5u2eQt8=; b=vRDIfxqjBS3BoFunlIoC5yZlHMe7dY3RJ3XldftwkdhxtWZIbVHjPtbGMR/TQJOdmc 7VxCTF0+Amop6AKj5oeQMjo7FXt17nocdAV7XMHb1hzRUbWVEH768ebRd8RErPNcir+K jrD3YYrkumGyNCn1fQzz9ahpaDMT7Nf8EcwDcb781LExIvxeyQIxdZ/C8qrd6cPqzAev bSBpVMyxJlbf/61k4UDXq97EZKDmX5cCtwNfPVzm16wI9JcI+Vg5j64ucj9R9ikee0zx 1F51n78WKbKmPmJp81huIFp1RTLr8uBFj99SciZ5g2vZsIkHe9MnsU5RvZ1yC8nm1QCG TxgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184si18599068pge.286.2019.07.26.05.32.57; Fri, 26 Jul 2019 05:33:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbfGZMat convert rfc822-to-8bit (ORCPT + 99 others); Fri, 26 Jul 2019 08:30:49 -0400 Received: from foss.arm.com ([217.140.110.172]:42518 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726277AbfGZMat (ORCPT ); Fri, 26 Jul 2019 08:30:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 499B7337; Fri, 26 Jul 2019 05:30:48 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [10.37.13.61]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6C4A13F694; Fri, 26 Jul 2019 05:30:46 -0700 (PDT) Date: Fri, 26 Jul 2019 13:30:44 +0100 Message-ID: <86ef2dnfkb.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Anders Roxell Cc: catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/2] arm64: KVM: regmap: Mark expected switch fall-through In-Reply-To: <20190726112705.19000-1-anders.roxell@linaro.org> References: <20190726112705.19000-1-anders.roxell@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Anders, On Fri, 26 Jul 2019 12:27:05 +0100, Anders Roxell wrote: > > When fall-through warnings was enabled by default, commit d93512ef0f0e > ("Makefile: Globally enable fall-through warning"), the following > warnings was starting to show up: > > In file included from ../arch/arm64/include/asm/kvm_emulate.h:19, > from ../arch/arm64/kvm/regmap.c:13: > ../arch/arm64/kvm/regmap.c: In function ‘vcpu_write_spsr32’: > ../arch/arm64/include/asm/kvm_hyp.h:31:3: warning: this statement may fall > through [-Wimplicit-fallthrough=] > asm volatile(ALTERNATIVE(__msr_s(r##nvh, "%x0"), \ > ^~~ > ../arch/arm64/include/asm/kvm_hyp.h:46:31: note: in expansion of macro ‘write_sysreg_elx’ > #define write_sysreg_el1(v,r) write_sysreg_elx(v, r, _EL1, _EL12) > ^~~~~~~~~~~~~~~~ > ../arch/arm64/kvm/regmap.c:180:3: note: in expansion of macro ‘write_sysreg_el1’ > write_sysreg_el1(v, SYS_SPSR); > ^~~~~~~~~~~~~~~~ > ../arch/arm64/kvm/regmap.c:181:2: note: here > case KVM_SPSR_ABT: > ^~~~ > In file included from ../arch/arm64/include/asm/cputype.h:132, > from ../arch/arm64/include/asm/cache.h:8, > from ../include/linux/cache.h:6, > from ../include/linux/printk.h:9, > from ../include/linux/kernel.h:15, > from ../include/asm-generic/bug.h:18, > from ../arch/arm64/include/asm/bug.h:26, > from ../include/linux/bug.h:5, > from ../include/linux/mmdebug.h:5, > from ../include/linux/mm.h:9, > from ../arch/arm64/kvm/regmap.c:11: > ../arch/arm64/include/asm/sysreg.h:837:2: warning: this statement may fall > through [-Wimplicit-fallthrough=] > asm volatile("msr " __stringify(r) ", %x0" \ > ^~~ > ../arch/arm64/kvm/regmap.c:182:3: note: in expansion of macro ‘write_sysreg’ > write_sysreg(v, spsr_abt); > ^~~~~~~~~~~~ > ../arch/arm64/kvm/regmap.c:183:2: note: here > case KVM_SPSR_UND: > ^~~~ > > Rework to add a 'break;' in the swich-case since it didn't have that. > That also made the compiler happy and didn't warn about fall-through. > > Cc: stable@vger.kernel.org # v3.16+ Erm... Are you sure about that? Here's what I have: $ git describe --contains a892819560c4 kvm-arm-for-v4.17~44 $ git describe --contains --match='v*' a892819560c4 v4.17-rc1~72^2~36^2~44 > Fixes: a892819560c4 ("KVM: arm64: Prepare to handle deferred save/restore of 32-bit registers") > Signed-off-by: Anders Roxell > --- > arch/arm64/kvm/regmap.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm64/kvm/regmap.c b/arch/arm64/kvm/regmap.c > index 0d60e4f0af66..a900181e3867 100644 > --- a/arch/arm64/kvm/regmap.c > +++ b/arch/arm64/kvm/regmap.c > @@ -178,13 +178,18 @@ void vcpu_write_spsr32(struct kvm_vcpu *vcpu, unsigned long v) > switch (spsr_idx) { > case KVM_SPSR_SVC: > write_sysreg_el1(v, SYS_SPSR); > + break; > case KVM_SPSR_ABT: > write_sysreg(v, spsr_abt); > + break; > case KVM_SPSR_UND: > write_sysreg(v, spsr_und); > + break; > case KVM_SPSR_IRQ: > write_sysreg(v, spsr_irq); > + break; > case KVM_SPSR_FIQ: > write_sysreg(v, spsr_fiq); > + break; > } > } Otherwise looks like the right fix to me. Let me know what you think about the Fixes: tag (no need to resend for that). Thanks, M. -- Jazz is not dead, it just smells funny.