Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3806663rdg; Wed, 18 Oct 2023 06:44:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHV5vR0RiJkThIfHOp67atEvw7Rfg8dylpBKJrmC5s3obCd5IoZGU/oAb29EuyksZIonDtV X-Received: by 2002:a05:6870:ec8a:b0:1e9:e063:ca6b with SMTP id eo10-20020a056870ec8a00b001e9e063ca6bmr6265261oab.32.1697636645957; Wed, 18 Oct 2023 06:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697636645; cv=none; d=google.com; s=arc-20160816; b=leTvBdenFQUni7iccs2cSIdFX0NVxzwCIh7JLVql9zHhyXRDLJjzlhOVeFJ9PfPNL3 zlcJvLjCtMzjaWPzaXfSfk+Xes/KCTPAtPdXgjesdKfXL1HFTUf0xr1SPBaKunxeW/KX jMnKZob2x4VhtnSKbhM1ckWMF8sSrfcxEUDsxDF19dwebaH/hynYZnV77kxsFWJIwQ4l cfevnd0Dmx7HrDxuZ9bRmMaRz+l3ZKCm+TEB7pPtFAGrNS+OZtttlJiuwvochxIWqiHR Qsiu2o+K7ccBfAbyd6ssvThbjAb3NCj5brK+K2kfILUkeZM+gnmOmH8RbTdiUagw/GMY 9I6A== 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=X8kIrslWDOXWhoHJov+e3SPTeZxOhaqsDjB2N84baz0=; fh=08nkjaW8CDtRXYyXjnJwUEKm1JSc9mnBVUEbsbJeqHQ=; b=ZaCe9UBsKSVF1EFq7yWnUz54n/3GtOx9lbrXEd2/nhtbgG8yFdkENSXQBnHLLcXVPN dkXu0CyoNl3aJrF/MydGN2HNaczr1Jpm1yS87fYKD9z6OX8rToPDqU1ey13h8oM8LoTV KM8aJSG6jeXu/UmZlOzjvbTRnM3ODheYAnl93GfGL+i5DcFtSIrcikdFWPAVXT5p+waO 8NOSevMJTZyti8DTTZpZINkXl+XJwqaYTpVXaP/mEsuDSGAZJ2OfGlCik2Jaw1Bzb1Lb ixMG2s7MR6A6or0Gf7836H5NA3sFoF/QllFpA587anqVx+JROyLBIgym3hji96/Ca5az dxzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=F9RHt7sh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t15-20020a63954f000000b00565f0e91894si970173pgn.394.2023.10.18.06.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 06:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=F9RHt7sh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id F22C18056A06; Wed, 18 Oct 2023 06:44:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344744AbjJRNn6 (ORCPT + 99 others); Wed, 18 Oct 2023 09:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344752AbjJRNn4 (ORCPT ); Wed, 18 Oct 2023 09:43:56 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25DBF11B; Wed, 18 Oct 2023 06:43:54 -0700 (PDT) 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 39IDfDg0005623; Wed, 18 Oct 2023 13:43:53 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=X8kIrslWDOXWhoHJov+e3SPTeZxOhaqsDjB2N84baz0=; b=F9RHt7sh0W3fogKes8yrJE3m+aIO5w4Yz3ffzWhYaajVWLmvmYpCAYawIHQtSPgLONTw IqWq+AGXNZzlfq4GvlxirnPW4Wso9Jiuqnl0U2yjeDoK0+j6rZei50eL1nJQwY3efWKO UuXOqyypHm0JRMJAev4T0sgXKee0iWHqhg2Dv4IMgozhdSxzO+/t5/Y1tuEN2Qjiu3pr 3zqbeUY74gqIwhnCzi22btWhSeKxdGttxrvGbTlXr8qNczg7mLEsQ9sxLugkFv1iBaFw KAbOdUv+VFt0Vs5Kqv0RmCKQ0ZNAjwCGKxuf5z6EE1sy6upyrPuehdSPCNUyiSI0A+/K RA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ttg4b92qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:43:50 +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 39IDgKoj011264; Wed, 18 Oct 2023 13:43:45 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ttg4b921k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:43:45 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39IDLQvR030742; Wed, 18 Oct 2023 13:38:35 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tr7hjrdsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 13:38:35 +0000 Received: from smtpav04.wdc07v.mail.ibm.com (smtpav04.wdc07v.mail.ibm.com [10.39.53.231]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39IDcYsG19858052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2023 13:38:34 GMT Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3806A58052; Wed, 18 Oct 2023 13:38:34 +0000 (GMT) Received: from smtpav04.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2315758045; Wed, 18 Oct 2023 13:38:33 +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:33 +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, Anthony Krowiak Subject: [PATCH v2 2/3] s390/vfio-ap: set status response code to 06 on gisc registration failure Date: Wed, 18 Oct 2023 09:38:24 -0400 Message-ID: <20231018133829.147226-3-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-GUID: jQx168nVdQ3x0oyq_7GuxS--V6M-belu X-Proofpoint-ORIG-GUID: vV0iWP7sobZ11OQO7qgNgKmawz0IGUI6 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 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180114 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 06:44:05 -0700 (PDT) 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. 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; } -- 2.41.0