Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1064895rdh; Fri, 27 Oct 2023 03:57:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7Qmix0s2cbxNqiUxDOecCw1koO5QHNgBXvL4uSzDUUZ2xQXudronzzjZpOJIxf75mtmGs X-Received: by 2002:a25:d654:0:b0:da0:5859:8465 with SMTP id n81-20020a25d654000000b00da058598465mr2231975ybg.20.1698404234683; Fri, 27 Oct 2023 03:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698404234; cv=none; d=google.com; s=arc-20160816; b=hOyT7P7mdi9TLB0K4+7SWmBbmqu8NdG5IwR4TYB2ajqFSimdJgbybBkmMxpA/weT4U LEFW4+hgmIm7xYK+MGZBpAcuaHChIx/nt4DhJ1ZwIJ+FFXIWHiWFkmtzlF9ZFd0Sf1Su 4+XfuewVb6zikj+jJGM2j0+Wx9FRodmNlWffRtJZzkvAVpZ7Pci/JTa3kMB258XARG6S 7ocYmztKxUa4qE/vwW+TwJda8DVlnqZm7KdiGLB4JTBGKvEw8rlmWwm6MWqDQDTau7LM M/BW37uQgeu+PnmNiBfC0fOgfD6NuBfoAU0CKtyfbcAgtPrXsvFYxyDRZ/2P6yy+OnPi iLJg== 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=3xTOujzU2+wfvwjQLEOWJbIoUBF5JE+bAZsliuvGrZc=; fh=BKhpxFUq++0ziUiw0HLK6XBv8zN57dtEuAU6XCBCP7U=; b=E9rzcTFUozRdapiWkLqUTmENHDWJFzPxD0g+ybQAl8tT8WbsakIy+Bg+TqcobxzxQC aLUOFYLkWaQ/5cF/1ffFG4VUIgAcfgwW9wMfl1FAAibMbNo+abIGei3x5KPaqWe5RqgA Wmw2ScB43iwse+LTSLctshEBwo2nMxY7lYlw1f+rgUi7nh3AGFi6eSRJ49ipwb2vUsdb RiMMSuMDX6txtxe6AeufFkHcqH8fnh5tk/CPpfc3/R13Q94U/OLh26Y3tPXTVV2bivJn VVjnuSZckNWfkuB+F5aDZNrEUhVCKGs1SHSH0UKd3hu0RvS4YoEzQNwZpt2Yccsc5ALj k3bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="er96YzU/"; 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 Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 3-20020a250a03000000b00da03eab5071si1866120ybk.194.2023.10.27.03.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 03:57:14 -0700 (PDT) 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="er96YzU/"; 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 5B44E825A85D; Fri, 27 Oct 2023 03:57:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345727AbjJ0K44 (ORCPT + 99 others); Fri, 27 Oct 2023 06:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345705AbjJ0K4x (ORCPT ); Fri, 27 Oct 2023 06:56:53 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7C8918F; Fri, 27 Oct 2023 03:56:50 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39RAjJTH023549; Fri, 27 Oct 2023 10:56:50 GMT 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=3xTOujzU2+wfvwjQLEOWJbIoUBF5JE+bAZsliuvGrZc=; b=er96YzU/6CqXwgpvpeq9EEZLkhQAm21cVl8uzuddC/ZIHFssj45d2/ZdR6UmMv+rB9In NjjNwYhpARUlxiMT7mW6LGFRf8vcE3rTnvA9Afl6Vi66wc9kvWX97V4l4We3wr0bkULy Ws41wGzk1EDIi7cZ/0kTbnqmbl3PPkMxL46p0ClpPMKqphOvj+o3PV2RQjKD6IXMAZos Irgtje/f1X8REbgt/+kFBNfbtkNjK824ryVPIlgOEbaYbU8bXxhsfh8g8gYdPuVKdlgB aPbjWBL9rajGrHDeW7PPPnnw+7Iri0flYTWAD7HotRUqZ9U+/G/8c6/930sXOtaYlap6 Dg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u0bqv8bw1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Oct 2023 10:56:49 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39RAl17H028892; Fri, 27 Oct 2023 10:56: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 3u0bqv8bvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Oct 2023 10:56:46 +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 39RASYoD021676; Fri, 27 Oct 2023 10:56:45 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tywqscgay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Oct 2023 10:56:45 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39RAugOc11141710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 Oct 2023 10:56:42 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 441142004B; Fri, 27 Oct 2023 10:56:42 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B78420043; Fri, 27 Oct 2023 10:56:42 +0000 (GMT) Received: from li-ce58cfcc-320b-11b2-a85c-85e19b5285e0 (unknown [9.152.224.212]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 27 Oct 2023 10:56:41 +0000 (GMT) Date: Fri, 27 Oct 2023 12:56:38 +0200 From: Halil Pasic To: Tony Krowiak Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jjherne@linux.ibm.com, borntraeger@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com, david@redhat.com, Halil Pasic Subject: Re: [PATCH v2 2/3] s390/vfio-ap: set status response code to 06 on gisc registration failure Message-ID: <20231027125638.67a65ab9.pasic@linux.ibm.com> In-Reply-To: <20231018133829.147226-3-akrowiak@linux.ibm.com> References: <20231018133829.147226-1-akrowiak@linux.ibm.com> <20231018133829.147226-3-akrowiak@linux.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ccMaKxqSscfAkitskD15OcwWmpme2vXw X-Proofpoint-ORIG-GUID: TnkQt8qym4ubyKi7kND7DFziGp3zYyWx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-27_08,2023-10-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 adultscore=0 mlxlogscore=999 clxscore=1011 impostorscore=0 phishscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310240000 definitions=main-2310270093 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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 27 Oct 2023 03:57:11 -0700 (PDT) On Wed, 18 Oct 2023 09:38:24 -0400 Tony Krowiak wrote: > From: Anthony Krowiak > > 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 does not make sense because the non-zero return code from the > kvm_s390_gisc_register function can be due one of two things: Either the > ISC passed as a parameter by the guest to the PQAP(AQIC) command is greater > than the maximum ISC value allowed, or the guest is not using a GISA. The "ISC passed as a parameter by the guest to the PQAP(AQIC) command is greater than the maximum ISC value allowed" is not possible. The isc is 3 bits wide and all 8 values that can be represented on 3 bits are valid. This is only possible if the hypervisor was to mess up, or if the machine was broken. > > Since this scenario is very unlikely to happen and there is no status > response code to indicate an invalid ISC value, 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 indicating > that the ZONE/GISA designation is invalid which is something the guest > can do nothing about since those values are set by the hypervisor. > > Signed-off-by: Anthony Krowiak > Suggested-by: Halil Pasic > --- > 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; > } >