Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1158205pxb; Tue, 19 Oct 2021 22:44:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5Pmrp34wHHgwJHm0M+v+sNppYdDUdwjKvgSMZzgpxBa/6+8WW7HyCwU+Ughp/A8EQsfFX X-Received: by 2002:a63:d14:: with SMTP id c20mr32490634pgl.118.1634708693842; Tue, 19 Oct 2021 22:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634708693; cv=none; d=google.com; s=arc-20160816; b=huzIgS71h5Yk+SpCixAbefMIJ86tyNrUSo/zmNb/wRogzVC/EMpbX1Jxso/rx8A/MM RMSbyOGqD0pZOtNRbsmarenHGH1ENBBu792a8OhQ7+ywmtHhgLOGVOcQHQvHbWJYlXbV 2GPrgwq2SeAWm0Hmr0GEuDFvYjfzpGDklxO4pgrez4sNn8ewp2LOvg4JH2xjF6h9WqRp 9g7+D+UG2vuvDrygzrmZv4a0sHY8EGz3Gghi5L2QeT7zLogjRlZRh/4HKZaCPgGLTNJB qxxhmGa3zDVfYb/LU1pOjzBvpKS9yrbYGMAPCH8UBZW5PLjnbkRw/raYtrNCzxLfzQIZ LTpA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=LsmsjDz8ufn/9dtpdWXP879joKhLVvJtXc6M9Epow7w=; b=Vcbhz/77vHR9Mk8bmUx8Ihcg5b4vp1zmPV4MDQO76VUPB2ORBYeGfpxmEMPX+kZpDA dGy/saE1F7i5J388yrt9rfCjKX5kX+0iVyzUxS6qSQXIdOTDhs05iVq5HmgkeSd5L7w+ WBNWXnI/6FAr7KVfg+IXnjiB9WfX0OayAAsMGDG69NB2SPkK2D+R+Ux2Dj0ZQGsB410U l3BL2iFDqV2EUVRavmgFGI9vCZMBULxtUV5/0jU5MkxIpRkkNxE87h2RngyizjT84TUE +bE4aiXOGzWZVFl7EXdfrXMlUbPUdTd1BIMnfRYWeujLhoqUqvarQb8aww5QR+Pny1aa VJZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Lcc8QWU1; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pf14si7672647pjb.117.2021.10.19.22.44.40; Tue, 19 Oct 2021 22:44:53 -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=@ibm.com header.s=pp1 header.b=Lcc8QWU1; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229817AbhJTFp4 (ORCPT + 99 others); Wed, 20 Oct 2021 01:45:56 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:64614 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbhJTFpz (ORCPT ); Wed, 20 Oct 2021 01:45:55 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19K5frXk025946; Wed, 20 Oct 2021 01:43:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pp1; bh=LsmsjDz8ufn/9dtpdWXP879joKhLVvJtXc6M9Epow7w=; b=Lcc8QWU17/WnOXYwVcImfOngQ9DNbV9duAbcCggSnxroib6jvhYvxyV7hvKpUO2cI7uR qyf1xSTrvZqa8fHA403aii0yz12eDhe//bT3CG7ZSbeRqrJ+Y6clkOLDUxgkxfusfeFb cINxAWXzzvTr/VOleVcevy5lB5qtJ2N3lffwKVMaNmU5vhLHnzuUk2DOIQDXeCh5g0ot 9e3louN7wQgdctUOB13aE1HAKqVOix9ZQR73m7WB50OYG0ert6Mdblhen+Pbl4N11tl7 E6AHKpge3W++i6yn0S6rV2MYXLgU33mYqj3C61GGJPD5UMCvd33a4HHanyzn+Ghde3NK Sw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btca9s1jx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 01:43:42 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 19K5JpRR020935; Wed, 20 Oct 2021 01:43:41 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3btca9s1ja-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 01:43:41 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 19K5hS21020457; Wed, 20 Oct 2021 05:43:39 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04fra.de.ibm.com with ESMTP id 3bqpcbpfcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Oct 2021 05:43:38 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 19K5biKB38273458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Oct 2021 05:37:44 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 153D852051; Wed, 20 Oct 2021 05:43:35 +0000 (GMT) Received: from p-imbrenda (unknown [9.145.4.68]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 303F652057; Wed, 20 Oct 2021 05:43:34 +0000 (GMT) Date: Wed, 20 Oct 2021 07:39:35 +0200 From: Claudio Imbrenda To: Halil Pasic Cc: Christian Borntraeger , Janosch Frank , Michael Mueller , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, David Hildenbrand , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Pierre Morel , Tony Krowiak , Matthew Rosato , Niklas Schnelle , farman@linux.ibm.com, kvm@vger.kernel.org Subject: Re: [PATCH 2/3] KVM: s390: preserve deliverable_mask in __airqs_kick_single_vcpu Message-ID: <20211020073935.1419c1e3@p-imbrenda> In-Reply-To: <20211019175401.3757927-3-pasic@linux.ibm.com> References: <20211019175401.3757927-1-pasic@linux.ibm.com> <20211019175401.3757927-3-pasic@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: d3VYEYL9EK82y__Gzo8oF7HzvskZvDIm X-Proofpoint-ORIG-GUID: 9kNDa0CtaSUD1l-PrdSgZYnaty6lAFWL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-20_02,2021-10-19_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110200028 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Oct 2021 19:54:00 +0200 Halil Pasic wrote: > 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. > > Signed-off-by: Halil Pasic > Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()") Reviewed-by: Claudio Imbrenda > --- > 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 10722455fd02..2245f4b8d362 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;