[v2,3/3] s390/vfio-ap: improve reaction to response code 07 from PQAP(AQIC) command
Message ID | 20231018133829.147226-4-akrowiak@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4797640vqb; Wed, 18 Oct 2023 06:39:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0zANnuxWsDsWZLw+4j/iWxc0dO5nt9UCfmUXXv5gjQMPqY7vv1BkKFFpLKzUXp8UY843i X-Received: by 2002:a05:6a20:ce9a:b0:16c:b95c:6d38 with SMTP id if26-20020a056a20ce9a00b0016cb95c6d38mr4918473pzb.2.1697636352283; Wed, 18 Oct 2023 06:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697636352; cv=none; d=google.com; s=arc-20160816; b=VkMKEIriiRCKCzXHh6TNQatvr5ms7kIEF2XnUcfdQ6oV00njIz964FWBQMbaP5Jnw0 o2d7FHyEjxZDBId1AWgQKIl35mgB0daKE+Qzid1idYY9jFXfnk0NoCQB6sTG+8LZe5fJ F7lhfHmuAMH+w7ngeRkvKyv+1sKF+a/mwA/UZRmOfHLqNyPtQHp2lpBKmeH2XGKx2Btv Yo4VPBqEOrEn7RuLTNCIDEqrb9tIXEu0uv+D34rKsLCQJ1dD27qtRFQ5KCEX28aD3xJP jSgXoatTnkY+OEpjVFVdKuh+cCl0PAt6wt+wFre2BAt4MuMzZL60XwJ0rKPjIjb93t+n QKnQ== 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 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x65-20020a17090a6c4700b00277382d4803si1483184pjj.173.2023.10.18.06.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 06:39:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; 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 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 8042080241B3; Wed, 18 Oct 2023 06:39:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344720AbjJRNi6 (ORCPT <rfc822;zwp10758@gmail.com> + 23 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <akrowiak@linux.ibm.com> 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 <mjrosato@linux.ibm.com> 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 howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 06:39:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780100735734719245 X-GMAIL-MSGID: 1780100735734719245 |
Series |
a couple of corrections to the IRQ enablement function
|
|
Commit Message
Anthony Krowiak
Oct. 18, 2023, 1:38 p.m. UTC
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 <mjrosato@linux.ibm.com>
Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
---
drivers/s390/crypto/vfio_ap_ops.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On 10/18/23 9:38 AM, Tony Krowiak wrote: > 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 <mjrosato@linux.ibm.com> > Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> I went back-and-forth on whether this should be a stable/fixes candidate but I think no... I happened to notice it while reviewing other code, I'm not aware that it's ever created a visible issue, and it's on a pretty immediate error path. If anyone thinks it should be a stable candidate I have no objection but in that case would suggest to break the patch up to separate the new WARN from the fix.
On 10/26/23 10:15, Matthew Rosato wrote: > On 10/18/23 9:38 AM, Tony Krowiak wrote: >> 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 <mjrosato@linux.ibm.com> >> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com> > > Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> > > I went back-and-forth on whether this should be a stable/fixes candidate but I think no... I happened to notice it while reviewing other code, I'm not aware that it's ever created a visible issue, and it's on a pretty immediate error path. If anyone thinks it should be a stable candidate I have no objection but in that case would suggest to break the patch up to separate the new WARN from the fix. Nothing has ever been reported and is probably very unlikely to be reported; so, I agree it should not be a stable/fixes candidate. > > >
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,