Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3803706rdg; Wed, 18 Oct 2023 06:39:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHdG6Lky+5wRVikthdgfpG8KTYGtugnmENAZ/SmrUWGFnELCQ0mhrhhVamQL8WDRpskcHT X-Received: by 2002:a17:903:41ce:b0:1ca:4d35:b2ec with SMTP id u14-20020a17090341ce00b001ca4d35b2ecmr6295140ple.15.1697636351263; Wed, 18 Oct 2023 06:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697636351; cv=none; d=google.com; s=arc-20160816; b=U0mrm/YUGZyagISmNlY7JF7i4+whqjwy5ZgsMp29B87Ky0eWB6kr8KgweXdsPz6/eN qvaULtG2HWCgfQThxw8rHBTyD+QCNy+0bO8be/yLBSbCFeMYtst51Wwoqf7EQmaHFnM8 1XSIjBzEzyQXPc32YXK8ra2dFx4pWFj7GjiPcRgG/Lzxs5ZlWq+QPnWf3hFUrE9GHTaC n9vMVZgBGPaj+fAsgA1MlSr4SSzDuQgGQMyketSWfLR+wPnx1BWslkkp2Lh6aJAWo2GU YC9oG99/Pe5AmcgTyspY/WYEn+kEYERG32JUNZMget16Nkzbm8fL5wTpZfsJBTJ3GWnJ ehpw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ABZn9qKONJ6zRIGJSu6qk4lm2aWQ1K7ZAdwLu4s+AL0=; fh=vxEorB+yPtSMJ8BpiXvcSYO8G1zMgo/xj5h2awmpn/k=; b=kD3oc+aKaK6qkiN3zPJQM6uVwWOkeYPvQgWZKPgTe0kg5RV69g06wZIiy0zrXaQEI7 6OkiaOIsaK5XBr9keo3yKtFZhYAXHnjg6TSdYxnFXkYx2zUzxraF9rUFHGWosP+4tKc5 tv46+GXnlYuVVh229c6Nw+rzt8nOO0ORzVW/amkpQTX+nHgz3wfE1MKjORFI0UFOUuWm 77a4ymFqH24tkWrk26/w8jiFx91EdRWvdg6DCWxfQPh33G4sl2sYXWz54rBy0Wz6mXzG 4oonfkmGQqVg2PQ3S5PkDR8CK/8sXL/ddJL5znNWyzAf+KEDX42NjqHah6aV0zSVHz1a 6n8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mo9J+5Vk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id h4-20020a170902eec400b001c72c792794si3961657plb.47.2023.10.18.06.39.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 06:39:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mo9J+5Vk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 59F17808A34F; Wed, 18 Oct 2023 06:39:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344709AbjJRNi6 (ORCPT + 99 others); Wed, 18 Oct 2023 09:38:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbjJRNit (ORCPT ); Wed, 18 Oct 2023 09:38:49 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B7A883; Wed, 18 Oct 2023 06:38:48 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39IDWKad010627; Wed, 18 Oct 2023 13:38:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ABZn9qKONJ6zRIGJSu6qk4lm2aWQ1K7ZAdwLu4s+AL0=; b=mo9J+5Vk7So4y48hPVocFSubGUnNGthROWMwD83Ew+EuSbRpCKzYK70VXPbN/IC0zLK0 0SIxmXNCyW9wDOK3VSGOsiU9IjyCtxEiPY+bYamdqHIPgmas88Ec+nsvXPiJAUDaCj9b hUPHiFaUaNK6L6tNxkPaREi7JtH8Guu5dNfJobEiUTRcht7mB9/xh7OGGYgEDyU/jnM7 DPr1cLkj+oWhV/UupfNbHACx3faIIzKwO20pkxymi0/7i+ysGjvdAQqq9ADmt3EgXTaW tofe2spDPsPFBki01iKEMzarDJFOmBcKJVxn3rG1T0TdjQdXGHvb8iYtWsFlhjXiXdbr nQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ttgb389ws-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:38:47 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39IDWROJ011520; Wed, 18 Oct 2023 13:38:46 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ttgb389gy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:38:45 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39IDOoQc027190; Wed, 18 Oct 2023 13:38:36 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tr6tkgkwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:38:36 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39IDcZAW17826394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2023 13:38:35 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74A3858050; Wed, 18 Oct 2023 13:38:35 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6216B5805E; Wed, 18 Oct 2023 13:38:34 +0000 (GMT) Received: from li-2c1e724c-2c76-11b2-a85c-ae42eaf3cb3d.ibm.com.com (unknown [9.61.47.87]) by smtpav04.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Oct 2023 13:38:34 +0000 (GMT) From: Tony Krowiak To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jjherne@linux.ibm.com, pasic@linux.ibm.com, borntraeger@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com, david@redhat.com, Matthew Rosato Subject: [PATCH v2 3/3] s390/vfio-ap: improve reaction to response code 07 from PQAP(AQIC) command Date: Wed, 18 Oct 2023 09:38:25 -0400 Message-ID: <20231018133829.147226-4-akrowiak@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018133829.147226-1-akrowiak@linux.ibm.com> References: <20231018133829.147226-1-akrowiak@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ioNrpGu6ssS0kVVyUCM67ZswCA7AbsdL X-Proofpoint-GUID: k7QBsco6NLprPtkV1jcDNk8PzfILkzmP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-18_12,2023-10-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 mlxscore=0 phishscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180113 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 06:39:08 -0700 (PDT) Let's improve the vfio_ap driver's reaction to reception of response code 07 from the PQAP(AQIC) command when enabling interrupts on behalf of a guest: * Unregister the guest's ISC before the pages containing the notification indicator bytes are unpinned. * Capture the return code from the kvm_s390_gisc_unregister function and log a DBF warning if it fails. Suggested-by: Matthew Rosato Signed-off-by: Tony Krowiak --- drivers/s390/crypto/vfio_ap_ops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index 25d7ce2094f8..4e80c211ba47 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -476,8 +476,11 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q, break; case AP_RESPONSE_OTHERWISE_CHANGED: /* We could not modify IRQ settings: clear new configuration */ + ret = kvm_s390_gisc_unregister(kvm, isc); + if (ret) + VFIO_AP_DBF_WARN("%s: kvm_s390_gisc_unregister: rc=%d isc=%d, apqn=%#04x\n", + __func__, ret, isc, q->apqn); vfio_unpin_pages(&q->matrix_mdev->vdev, nib, 1); - kvm_s390_gisc_unregister(kvm, isc); break; default: pr_warn("%s: apqn %04x: response: %02x\n", __func__, q->apqn, -- 2.41.0