Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2828021pxb; Mon, 1 Nov 2021 02:40:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEU4hNuuCMQ8uHvKuBbMPXhRzyK1Siiv4/RFWDKx1bR6LZIKBcR9r3h3UvOmLPUjQVSZeQ X-Received: by 2002:a05:6638:3796:: with SMTP id w22mr21402235jal.126.1635759618784; Mon, 01 Nov 2021 02:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635759618; cv=none; d=google.com; s=arc-20160816; b=IOuumMYZPsCDObAkWkgiWw4kUyIEeawLEIGDECBs2jMAZckbVDFEa3vauT5Iwc79Yz ZMtI4pofOmY+vyj0oLQBYpfA3BHEisQ3u5a4Ga+tZYVqgB6KqiKi4FrUHWXcJLkm4NF+ QTqcoxOg58TQe8J3xaZO6DMTbZ4YOALbOvcZ1eKhryCwhwAHLL890BpjJJBUf7ZiqfID 61XJovFjLOMFJtqryhCohDgXig6SQZIbYSG3Y8iU8YWq2T46BGB/JvRwPIEQ9QUyGZL0 CXtqwA7eUV3+eoTADJ8lYvtuDUk5ThOzgrwIkPX20st4ciQJ6YGrio2v1a//z2p6qUpa Z8Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K2Yg8FjbVZlbvQfIxpLdgXXaGyIkwTSR6VTQfjknyKQ=; b=OsBNdKUpgK9bLgePSCK+ZaMe7yxRlCfaYsCQcw/XVWcrE7rqLULQeZ3NuWxsd6qly+ iXAH2ChrGlb+P65Z7M4VYcRRdgxxhqv/2aJRuQF4dGt2xLXqeTR0eQNCW3/0Cd6TQ8h6 q8hA5K9e84/557PdwRYcWTmLKLSCijaZT7Wt5/TKJpWK8eShxxJ999nAqQelVXMKB1HL jvLPiOFxjF9/aa/z7/X2ioanL87I3bIKaNcYw/36ax8N1pviYv9tl+cpRZibqDCT9kq7 fXifOvvQ9HRbQDG1SKsFK5WMXhAHS0TGQk4SDWmOiYQX63toUm5bXEcIJuw4RB6kvXZa jF8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Wj/ndx6H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u2si1266317ilq.43.2021.11.01.02.40.07; Mon, 01 Nov 2021 02:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Wj/ndx6H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232910AbhKAJln (ORCPT + 99 others); Mon, 1 Nov 2021 05:41:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:47846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233416AbhKAJjp (ORCPT ); Mon, 1 Nov 2021 05:39:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 967E9610FD; Mon, 1 Nov 2021 09:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758840; bh=WkUFtUsxhV7nYYV2Mgej/hXZziSAYyjnb5QunoCk30U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wj/ndx6H8R++J8jttPKQuYfpOehpSpN4ddUMmosptDPotxGPYjiWSSc33U/IpV50i nrka0y7blMfWgCkyBezzwL8jnp9Q7JmkqY4bfx78ZgooICqpd7rei439ll1vhry0O0 OtQtSOkUrJHM6Im6zc65B5fmsKDMVyIEpiHFneW4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Halil Pasic , Christian Borntraeger , Michael Mueller , Claudio Imbrenda , Sasha Levin Subject: [PATCH 5.10 73/77] KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu Date: Mon, 1 Nov 2021 10:18:01 +0100 Message-Id: <20211101082526.770300153@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082511.254155853@linuxfoundation.org> References: <20211101082511.254155853@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Halil Pasic [ Upstream commit 0e9ff65f455dfd0a8aea5e7843678ab6fe097e21 ] 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: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()") Signed-off-by: Halil Pasic Reviewed-by: Christian Borntraeger Reviewed-by: Michael Mueller Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20211019175401.3757927-3-pasic@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Sasha Levin --- arch/s390/kvm/interrupt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 2bb9996ff09b..e6c4f29fc695 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c @@ -3053,13 +3053,14 @@ static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask) int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus); struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int; struct kvm_vcpu *vcpu; + u8 vcpu_isc_mask; for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) { vcpu = kvm_get_vcpu(kvm, vcpu_idx); if (psw_ioint_disabled(vcpu)) continue; - deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24); - if (deliverable_mask) { + vcpu_isc_mask = (u8)(vcpu->arch.sie_block->gcr[6] >> 24); + if (deliverable_mask & vcpu_isc_mask) { /* lately kicked but not yet running */ if (test_and_set_bit(vcpu_idx, gi->kicked_mask)) return; -- 2.33.0