Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp122623ybi; Fri, 26 Jul 2019 07:07:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQ5LC3g8uJSGjoEPTR88I+PdnXSL7SWsMaKG4w6B3s1EaWAfIgJMIZSTjuActVRD+H8Ddy X-Received: by 2002:a63:1c22:: with SMTP id c34mr91029124pgc.56.1564150031217; Fri, 26 Jul 2019 07:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564150031; cv=none; d=google.com; s=arc-20160816; b=xW/VjUu/3OQiLnVS6BctIbwwedUmr/lEgJeDfTRqa5QTEnn3egBgRMcq4OUDQY4sF/ FNhnmnNlmV6GxPevT85mVir6HXPF/jF1X0iG3zmUMJ4XwTX4k5bBUzj1kH3jZaoNXVXI mJ+VplHYyyzf0NudwIGfFXh+Hl5MJINu2L/QTLkOU5DHtBOZiQZRgHWR0T42ppxUprxm GlN8sa5cPZSlw9syuzwt9cg9+Pl47w9fpc55VVdMFwUoWmMmv8wjwYyCZF8aDwVM1Yj+ kCjxl7uz2W+XZtgouoLvDGYmVo04bW1lw8lqUbnZi2f0jLyV1B/mgeg9TxnqvpmodONu qQug== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XRsk0iEI3zTElR2u2jt3WIaXl85qXr9Noy6MPl/LLlU=; b=PXmvkOluLqQoUBJLc9T5Cbt8J7ELS4kLaWqlY2Zjbx5knlof7LK5yDDqhWy/Y93S7o JuVZFnmFkAXHc1OA6h7i7hEbW8K0fil+a3VL1ggzIjcpaTDXzSNwCLADxOm3HKUVO54T EQpki5t1xaa+n0kjQaDQM2JW81MwEG8PLFbRu44Sizfb3wYXhI2X7MbXjv7nATBwPHZ6 Y+s8k84xnQyDn0fKd0x4Qk7LE0OmDa5dykjX4nms77CioQZK6linvAvPJEyjjrLJJI01 fG8yrywarNw7MpmnAtDqT3EhmOd39TdBNTyO+Q7vyoj8GEB2at5k4pmY0Ra6px6Qm/qj 3nww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OX77yu64; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e66si18190415plb.254.2019.07.26.07.06.55; Fri, 26 Jul 2019 07:07:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=OX77yu64; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbfGZOFP (ORCPT + 99 others); Fri, 26 Jul 2019 10:05:15 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:33786 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbfGZOFP (ORCPT ); Fri, 26 Jul 2019 10:05:15 -0400 Received: by mail-lf1-f65.google.com with SMTP id x3so37266920lfc.0 for ; Fri, 26 Jul 2019 07:05:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XRsk0iEI3zTElR2u2jt3WIaXl85qXr9Noy6MPl/LLlU=; b=OX77yu642sxgg1HWdyQx9x41cx1WuDT18/aO9UX6rY4u4nAODv+wC6yhBaw3+9QX5T dBV1+B9FKTO/C+WlDI5n+NiBhKRsKNedmV8BCjk0uTgaB5MapIid4HUVGa8JaZKYD3yD nlg5wjSYvBF7Gf8MnPUS+JftzW8zigSkaenRy2Uw5jyAdHFjkJIQ8Oe3qzzp0Jl3BdRY UvCzsbkTsgl3SeExNSjo80CItXkQUHBePxaN2g7ANgbH7nPjhp5EV5EQ5W5GwhhAT7za mYlEKOBBkzDnZNJeVptuM4S9BVNtUQrKp6ObQSUIgCqUFZn3URJCZvD2air0iweLKLrk Y+Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XRsk0iEI3zTElR2u2jt3WIaXl85qXr9Noy6MPl/LLlU=; b=Wof6LIX2Dpj6iniyBuZrPfufAB2t2KAnIJPWgYWpEzVU+Uad5DeByLaDwjGagP+3kk 0sWc1Za6hji+teP72BWuaBd943+vnJ3/kA0Achl5NtiD+AJiaj75iepUsl5H8LLllL4h /0J/mbHLuL4xwSqT7pbglE6XjDV2M+Q2uXfOShWKCy4+t7MZgk73xazfbAzJewP40ify UvwtcdGnvDFcRL6bJTFv3RhsmQcFRrvD3QP7HQulogt9HNhuxXVI3KjyDITcSdyau9le qVVDc9Qhgv5cs0AXfIOCcF3SMdtoc5qNVOAYDl7td1+LAr68A3T0W0X8lrq9TigRHwMN LYTA== X-Gm-Message-State: APjAAAVW13Xphu3C9dZxzjoembT26n5M7yAKT/YZAOtntSlOM4BPpqXH OdXehFdKbgaVbISuk+CNJGJymqMCAfwaPC5AmqHw9w== X-Received: by 2002:ac2:44b1:: with SMTP id c17mr33687690lfm.87.1564149912518; Fri, 26 Jul 2019 07:05:12 -0700 (PDT) MIME-Version: 1.0 References: <20190726112705.19000-1-anders.roxell@linaro.org> <86ef2dnfkb.wl-marc.zyngier@arm.com> In-Reply-To: <86ef2dnfkb.wl-marc.zyngier@arm.com> From: Anders Roxell Date: Fri, 26 Jul 2019 16:05:01 +0200 Message-ID: Subject: Re: [PATCH 1/2] arm64: KVM: regmap: Mark expected switch fall-through To: Marc Zyngier Cc: Catalin Marinas , will@kernel.org, Linux ARM , kvmarm@lists.cs.columbia.edu, Linux Kernel Mailing List , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 26 Jul 2019 at 14:30, Marc Zyngier wrote: > > 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 =E2=80=98vcpu_write_spsr32=E2= =80=99: > > ../arch/arm64/include/asm/kvm_hyp.h:31:3: warning: this statement may f= all > > through [-Wimplicit-fallthrough=3D] > > asm volatile(ALTERNATIVE(__msr_s(r##nvh, "%x0"), \ > > ^~~ > > ../arch/arm64/include/asm/kvm_hyp.h:46:31: note: in expansion of macro = =E2=80=98write_sysreg_elx=E2=80=99 > > #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 =E2=80=98= write_sysreg_el1=E2=80=99 > > 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 f= all > > through [-Wimplicit-fallthrough=3D] > > asm volatile("msr " __stringify(r) ", %x0" \ > > ^~~ > > ../arch/arm64/kvm/regmap.c:182:3: note: in expansion of macro =E2=80=98= write_sysreg=E2=80=99 > > 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? I made two mistakes. 1. saying 3.x instead of 4.x 2. I said the same kernel that 'git describe' showed and not the later one. I did not know about '--match=3D'. > Here's what I have: > > $ git describe --contains a892819560c4 > kvm-arm-for-v4.17~44 > $ git describe --contains --match=3D'v*' a892819560c4 > v4.17-rc1~72^2~36^2~44 That's correct. > > > > Fixes: a892819560c4 ("KVM: arm64: Prepare to handle deferred save/resto= re 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, uns= igned 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). It should be v4.17+. Cheers, Anders