Skip to content

Commit 0e9ff65

Browse files
halil-pasicborntraeger
authored andcommitted
KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu
Changing the deliverable mask in __airqs_kick_single_vcpu() is a bug. If one idle vcpu can't take the interrupts we want to deliver, we should look for another vcpu that can, instead of saying that we don't want to deliver these interrupts by clearing the bits from the deliverable_mask. Fixes: 9f30f62 ("KVM: s390: add gib_alert_irq_handler()") 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 9b57e9d commit 0e9ff65

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/s390/kvm/interrupt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3053,13 +3053,14 @@ static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask)
30533053
int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus);
30543054
struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
30553055
struct kvm_vcpu *vcpu;
3056+
u8 vcpu_isc_mask;
30563057

30573058
for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) {
30583059
vcpu = kvm_get_vcpu(kvm, vcpu_idx);
30593060
if (psw_ioint_disabled(vcpu))
30603061
continue;
3061-
deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
3062-
if (deliverable_mask) {
3062+
vcpu_isc_mask = (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
3063+
if (deliverable_mask & vcpu_isc_mask) {
30633064
/* lately kicked but not yet running */
30643065
if (test_and_set_bit(vcpu_idx, gi->kicked_mask))
30653066
return;

0 commit comments

Comments
 (0)