Skip to content

Commit 9b57e9d

Browse files
halil-pasicborntraeger
authored andcommitted
KVM: s390: clear kicked_mask before sleeping again
The idea behind kicked mask is that we should not re-kick a vcpu that is already in the "kick" process, i.e. that was kicked and is is about to be dispatched if certain conditions are met. The problem with the current implementation is, that it assumes the kicked vcpu is going to enter SIE shortly. But under certain circumstances, the vcpu we just kicked will be deemed non-runnable and will remain in wait state. This can happen, if the interrupt(s) this vcpu got kicked to deal with got already cleared (because the interrupts got delivered to another vcpu). In this case kvm_arch_vcpu_runnable() would return false, and the vcpu would remain in kvm_vcpu_block(), but this time with its kicked_mask bit set. So next time around we wouldn't kick the vcpu form __airqs_kick_single_vcpu(), but would assume that we just kicked it. Let us make sure the kicked_mask is cleared before we give up on re-dispatching the vcpu. Fixes: 9f30f62 ("KVM: s390: add gib_alert_irq_handler()") Reported-by: Matthew Rosato <[email protected]> Signed-off-by: Halil Pasic <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Reviewed-by: Michael Mueller <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Borntraeger <[email protected]>
1 parent 25b5476 commit 9b57e9d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,6 +3363,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
33633363

33643364
int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
33653365
{
3366+
clear_bit(vcpu->vcpu_idx, vcpu->kvm->arch.gisa_int.kicked_mask);
33663367
return kvm_s390_vcpu_has_irq(vcpu, 0);
33673368
}
33683369

0 commit comments

Comments
 (0)