Re: arch/x86/kvm/x86.c:7111:23: warning: this statement may fall through [-Wimplicit-fallthrough=]

From: Paolo Bonzini
Date: Mon Jan 15 2018 - 08:32:15 EST


On 15/01/2018 13:34, David Binderman wrote:
> Hello there,
>
>
> Source code is
>
>
>     switch(vcpu->arch.mp_state) {
>     case KVM_MP_STATE_HALTED:
>         vcpu->arch.pv.pv_unhalted = false;
>         vcpu->arch.mp_state =
>             KVM_MP_STATE_RUNNABLE;
>     case KVM_MP_STATE_RUNNABLE:
>         vcpu->arch.apf.halted = false;
>         break;
>
> Suggest either add the missing break or add a fallthrough comment.

It's meant to be a fall-through to the "runnable" case (note that
mp_state becomes KVM_MP_STATE_RUNNABLE at the end of the first "case").

Would you like to post a patch yourself?

Thanks,

Paolo

>
>
> Regards
>
>
> David Binderman
>
>