Message ID | 20231129145404.263764-3-akrowiak@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp391444vqn; Wed, 29 Nov 2023 06:54:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9rzKsorb5hGL+AyxxZ9SDjbBJBisDdPlAQqb6RSoGy7wpehRZVl/koX9NyOT9htQ3folk X-Received: by 2002:a17:902:ea0d:b0:1cf:c9c2:5fde with SMTP id s13-20020a170902ea0d00b001cfc9c25fdemr10227735plg.2.1701269671594; Wed, 29 Nov 2023 06:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701269671; cv=none; d=google.com; s=arc-20160816; b=Be7jsYsD2Gite9YzLzp0XPhjAhoqaZPxYRrHVApZHzY5BMhJ+ikStdt1aqMN6QtZ3O TwbqUm4Tond6ZpfRH08CNdXSIeXYxJyoHL1vZ0nVqRAs2C0z60nD31jKg9wOroZS+/Tg OvAV1MZvqvOYOJGIESp8yoKsZWXHAnCzuyZKTYCIElEBU3Hiv83LrUFe/j6LtWlM2Hq+ +pL1+PG7lfwk2TFEYj86+cWvZVNTx3TVqjGHbnEVDz8Phm9yTJwbQ/gE7U9ty4fgyyFe TXdbP8lATg133ARDzRK8hxuhJ7Gykf2nM7x1OKe9WhIQTJzTGleUOptf7gBN3QJPiS1l OwGQ== 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=+EpOuQfInHbEJvdxDuaqHuhXP08YQJRjuL00fRbmA0E=; fh=PYriMT7wNBTeDkws9cgbbOWLcget9q0bI/zIn6VaslM=; b=vDj1+eU8gCp26cKGn5pHWLyc9rQCbUF7Fu0Vq5mfnlm1Ut6nnMX2uW0AOj7dtsp9af tLlmcth/dvIzaONV22zEeMB9Wuvq5tp0d0thmiuLJVtF8GUwt9y4h0TeShZIIta9q6Vr OcmQbny7AbXDFwoQnmMMwbrOA1i+lKHmg9LzKIhluy7wlxEQxX+NEwqQfTBauyVL1T1q ybQut0lstPLoP70fHgX7i0TrC31FncybOogZbeOWDbJBi0HIHj7GWQLKynZEbapfbLk8 jVav36EyA5wZNg9+4N3/SJ1t1OnjJeM1HhgR8CeALnBx+osO8701jyEGV2s66hDn8S3o naUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GqmhVTuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c10-20020a170902724a00b001cfa573ca16si5001742pll.343.2023.11.29.06.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 06:54:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=GqmhVTuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 8915580401A8; Wed, 29 Nov 2023 06:54:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234696AbjK2OyO (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Wed, 29 Nov 2023 09:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234732AbjK2OyJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Nov 2023 09:54:09 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1DC7D63; Wed, 29 Nov 2023 06:54:15 -0800 (PST) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3ATEqY1q016228; Wed, 29 Nov 2023 14:54:14 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=+EpOuQfInHbEJvdxDuaqHuhXP08YQJRjuL00fRbmA0E=; b=GqmhVTuNhOeiIQt2V0vpUMwZrvalvlRW0pqOehMbJ6/9nCUynubK4ej27jo1iEhMNGKx B3m+nddrbvskF5cESljw3zMkh5zZ2LcukpEpf3FHVW0y328gtSjkbTKWPLVKlUaZ7r6f qS+QjINdGQpZ0FQideTF442qUKGgARBttULnIUcryF7Gj0a2Qudl3F/QoLbe9XRbn5xK UycL6OjpIpp975aCv2nkf7BLKGHQl7Y+cHGaWhetKBSJ/OyZ/nVbq1sXLzXNj4g0VR3e j58BTD1eIQEZfeCqLXgnfAgPQpFFjiIk25Ie11dhUmRjWaHUGd8OweQkV0Mc5VVC/Dk1 Tg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3up7ekr33q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 14:54:13 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3ATEqokl017256; Wed, 29 Nov 2023 14:54:13 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 3up7ekr31x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 14:54:13 +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 3ATEGmdk001601; Wed, 29 Nov 2023 14:54:11 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ukvrkqpsy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Nov 2023 14:54:11 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3ATEsA9E7144036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Nov 2023 14:54:10 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60BD75805B; Wed, 29 Nov 2023 14:54:10 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E04BC58058; Wed, 29 Nov 2023 14:54:08 +0000 (GMT) Received: from li-2c1e724c-2c76-11b2-a85c-ae42eaf3cb3d.ibm.com.com (unknown [9.61.149.198]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 29 Nov 2023 14:54:08 +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, alex.williamson@redhat.com, borntraeger@linux.ibm.com, kwankhede@nvidia.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com, david@redhat.com, Anthony Krowiak <akrowiak@linux.ibm.com>, Harald Freudenberger <freude@linux.ibm.com> Subject: [PATCH v4 2/3] s390/vfio-ap: set status response code to 06 on gisc registration failure Date: Wed, 29 Nov 2023 09:54:00 -0500 Message-ID: <20231129145404.263764-3-akrowiak@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231129145404.263764-1-akrowiak@linux.ibm.com> References: <20231129145404.263764-1-akrowiak@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dhI5mwr8kUFyWoWLQWXYiL_WS4tDiQ-0 X-Proofpoint-ORIG-GUID: _nCNU8Oatca5MMW-6pr43PRL2zaVCh8G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-29_12,2023-11-29_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 adultscore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311290113 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 06:54:28 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783910547308490952 X-GMAIL-MSGID: 1783910547308490952 |
Series |
a couple of corrections to the IRQ enablement function
|
|
Commit Message
Anthony Krowiak
Nov. 29, 2023, 2:54 p.m. UTC
From: Anthony Krowiak <akrowiak@linux.ibm.com> The interception handler for the PQAP(AQIC) command calls the kvm_s390_gisc_register function to register the guest ISC with the channel subsystem. If that call fails, the status response code 08 - indicating Invalid ZONE/GISA designation - is returned to the guest. This response code is not valid because setting the ZONE/GISA values is the responsibility of the hypervisor controlling the guest and there is nothing that can be done from the guest perspective to correct that problem. The likelihood of GISC registration failure is nil and there is no status response code to indicate an invalid ISC value, so let's set the response code to 06 indicating 'Invalid address of AP-queue notification byte'. While this is not entirely accurate, it is better than setting a response code which makes no sense for the guest. Signed-off-by: Anthony Krowiak <akrowiak@linux.ibm.com> Suggested-by: Halil Pasic <pasic@linux.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> --- drivers/s390/crypto/vfio_ap_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Comments
Am 29.11.23 um 15:54 schrieb Tony Krowiak: > From: Anthony Krowiak <akrowiak@linux.ibm.com> > > The interception handler for the PQAP(AQIC) command calls the > kvm_s390_gisc_register function to register the guest ISC with the channel > subsystem. If that call fails, the status response code 08 - indicating > Invalid ZONE/GISA designation - is returned to the guest. This response > code is not valid because setting the ZONE/GISA values is the > responsibility of the hypervisor controlling the guest and there is nothing > that can be done from the guest perspective to correct that problem. > > The likelihood of GISC registration failure is nil and there is no status > response code to indicate an invalid ISC value, so let's set the response > code to 06 indicating 'Invalid address of AP-queue notification byte'. > While this is not entirely accurate, it is better than setting a response > code which makes no sense for the guest. > > Signed-off-by: Anthony Krowiak <akrowiak@linux.ibm.com> > Suggested-by: Halil Pasic <pasic@linux.ibm.com> > Reviewed-by: Halil Pasic <pasic@linux.ibm.com> > Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com> should go via the s390 tree > --- > drivers/s390/crypto/vfio_ap_ops.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c > index 9cb28978c186..25d7ce2094f8 100644 > --- a/drivers/s390/crypto/vfio_ap_ops.c > +++ b/drivers/s390/crypto/vfio_ap_ops.c > @@ -393,8 +393,8 @@ static int ensure_nib_shared(unsigned long addr, struct gmap *gmap) > * Register the guest ISC to GIB interface and retrieve the > * host ISC to issue the host side PQAP/AQIC > * > - * Response.status may be set to AP_RESPONSE_INVALID_ADDRESS in case the > - * vfio_pin_pages failed. > + * status.response_code may be set to AP_RESPONSE_INVALID_ADDRESS in case the > + * vfio_pin_pages or kvm_s390_gisc_register failed. > * > * Otherwise return the ap_queue_status returned by the ap_aqic(), > * all retry handling will be done by the guest. > @@ -458,7 +458,7 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q, > __func__, nisc, isc, q->apqn); > > vfio_unpin_pages(&q->matrix_mdev->vdev, nib, 1); > - status.response_code = AP_RESPONSE_INVALID_GISA; > + status.response_code = AP_RESPONSE_INVALID_ADDRESS; > return status; > } >
diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c index 9cb28978c186..25d7ce2094f8 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -393,8 +393,8 @@ static int ensure_nib_shared(unsigned long addr, struct gmap *gmap) * Register the guest ISC to GIB interface and retrieve the * host ISC to issue the host side PQAP/AQIC * - * Response.status may be set to AP_RESPONSE_INVALID_ADDRESS in case the - * vfio_pin_pages failed. + * status.response_code may be set to AP_RESPONSE_INVALID_ADDRESS in case the + * vfio_pin_pages or kvm_s390_gisc_register failed. * * Otherwise return the ap_queue_status returned by the ap_aqic(), * all retry handling will be done by the guest. @@ -458,7 +458,7 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q, __func__, nisc, isc, q->apqn); vfio_unpin_pages(&q->matrix_mdev->vdev, nib, 1); - status.response_code = AP_RESPONSE_INVALID_GISA; + status.response_code = AP_RESPONSE_INVALID_ADDRESS; return status; }