From: Marc Zyngier <maz@kernel.org>
To: Matteo Croce <mcroce@redhat.com>,
linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic-v3: mark expected switch fall-through
Date: Mon, 29 Jul 2019 10:52:23 +0100 [thread overview]
Message-ID: <e59eb35f-a83b-69e4-c72f-fe3f674f1fec@kernel.org> (raw)
In-Reply-To: <20190728233347.7856-1-mcroce@redhat.com>
On 29/07/2019 00:33, Matteo Croce wrote:
> Mark switch cases where we are expecting to fall through,
> fixes the following warning:
>
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c: In function ‘__vgic_v3_save_aprs’:
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:351:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> cpu_if->vgic_ap0r[2] = __vgic_v3_read_ap0rn(2);
> ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:352:2: note: here
> case 6:
> ^~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:353:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> cpu_if->vgic_ap0r[1] = __vgic_v3_read_ap0rn(1);
> ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:354:2: note: here
> default:
> ^~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:361:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> cpu_if->vgic_ap1r[2] = __vgic_v3_read_ap1rn(2);
> ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:362:2: note: here
> case 6:
> ^~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:363:24: warning: this statement may fall through [-Wimplicit-fallthrough=]
> cpu_if->vgic_ap1r[1] = __vgic_v3_read_ap1rn(1);
> ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:364:2: note: here
> default:
> ^~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c: In function ‘__vgic_v3_restore_aprs’:
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:384:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[2], 2);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:385:2: note: here
> case 6:
> ^~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:386:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[1], 1);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:387:2: note: here
> default:
> ^~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:394:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[2], 2);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:395:2: note: here
> case 6:
> ^~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:396:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[1], 1);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm64/kvm/hyp/../../../../virt/kvm/arm/hyp/vgic-v3-sr.c:397:2: note: here
> default:
> ^~~~~~~
>
> Signed-off-by: Matteo Croce <mcroce@redhat.com>
> ---
> virt/kvm/arm/hyp/vgic-v3-sr.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/virt/kvm/arm/hyp/vgic-v3-sr.c b/virt/kvm/arm/hyp/vgic-v3-sr.c
> index 254c5f190a3d..622fb4d18c5c 100644
> --- a/virt/kvm/arm/hyp/vgic-v3-sr.c
> +++ b/virt/kvm/arm/hyp/vgic-v3-sr.c
> @@ -349,8 +349,10 @@ void __hyp_text __vgic_v3_save_aprs(struct kvm_vcpu *vcpu)
> case 7:
> cpu_if->vgic_ap0r[3] = __vgic_v3_read_ap0rn(3);
> cpu_if->vgic_ap0r[2] = __vgic_v3_read_ap0rn(2);
> + /* fallthrough */
> case 6:
> cpu_if->vgic_ap0r[1] = __vgic_v3_read_ap0rn(1);
> + /* fallthrough */
> default:
> cpu_if->vgic_ap0r[0] = __vgic_v3_read_ap0rn(0);
> }
> @@ -359,8 +361,10 @@ void __hyp_text __vgic_v3_save_aprs(struct kvm_vcpu *vcpu)
> case 7:
> cpu_if->vgic_ap1r[3] = __vgic_v3_read_ap1rn(3);
> cpu_if->vgic_ap1r[2] = __vgic_v3_read_ap1rn(2);
> + /* fallthrough */
> case 6:
> cpu_if->vgic_ap1r[1] = __vgic_v3_read_ap1rn(1);
> + /* fallthrough */
> default:
> cpu_if->vgic_ap1r[0] = __vgic_v3_read_ap1rn(0);
> }
> @@ -382,8 +386,10 @@ void __hyp_text __vgic_v3_restore_aprs(struct kvm_vcpu *vcpu)
> case 7:
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[3], 3);
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[2], 2);
> + /* fallthrough */
> case 6:
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[1], 1);
> + /* fallthrough */
> default:
> __vgic_v3_write_ap0rn(cpu_if->vgic_ap0r[0], 0);
> }
> @@ -392,8 +398,10 @@ void __hyp_text __vgic_v3_restore_aprs(struct kvm_vcpu *vcpu)
> case 7:
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[3], 3);
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[2], 2);
> + /* fallthrough */
> case 6:
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[1], 1);
> + /* fallthrough */
> default:
> __vgic_v3_write_ap1rn(cpu_if->vgic_ap1r[0], 0);
> }
>
Already fixed here[1].
M.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git/commit/?id=1a8248c74c81a15a32dc3344fb5c622e19072791
--
Jazz is not dead, it just smells funny...
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
prev parent reply other threads:[~2019-07-29 9:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-28 23:33 [PATCH] KVM: arm64: vgic-v3: mark expected switch fall-through Matteo Croce
2019-07-29 9:52 ` Marc Zyngier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e59eb35f-a83b-69e4-c72f-fe3f674f1fec@kernel.org \
--to=maz@kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcroce@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).