Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp434816rdh; Thu, 26 Oct 2023 06:26:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUR75wl/DQ/XplJBCFuMakklhGIE98dL87NC3vGfIQ+2FBowsXBg4Tn75NBoz8SGqcaYhM X-Received: by 2002:a25:ad05:0:b0:da0:4f22:4eda with SMTP id y5-20020a25ad05000000b00da04f224edamr7402379ybi.36.1698326777310; Thu, 26 Oct 2023 06:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698326777; cv=none; d=google.com; s=arc-20160816; b=0SQL8BnrpmfgKY3XboOY7WjwzwNyf8H26z70c1dPIGyUU/Nz0NuYUo759eCqTGxB/1 ANVVOFYpbqJSVkuX5XUvaWgXy7LafPqSSrWLzHdmP4v4Wj5/kDWBAYlFFvpqL1uFkssc s6VCpmA8EZ1Ut8S8JCJ1Y9RtZHjUdOUEKjDA8CJlhiIpH8+IyzaVxPV/Z/Ukwxa7YOmr acsyJuOucvnydzviUGQREQlsQHTDR49mO0WYzL70e08T+d1dyKgdvBjmgyDpTVDiVGq1 wCZabraKAmjYwcFWn580xu1ouXXi7wJg9zRl0kCkOglHDdAQWSK08lbC6uCPfFPWpG89 O4nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=NjrTRAfQTM5iisUaJmjdVLpMsjB19VmS9PCtPLo7muE=; fh=fHMhKY6lDSCEHKSykwVcFUoIbvE5IfH5GTV/7cGOV+o=; b=X4oqpZVDPFPhGUNGW1ZFpFvso1SD/n8dZ3u0Uxad4pYA3pPSyLXaH2u4etRIxuel04 y2JukyoPh1Qd29/1zGk2EQsL9JswmFDQv+shCWUlxU0o/4WuNGl/6MI+1YpUq7kLJxh8 wHxIP98E/HYh6xH5Cf7SCQrLTEY4/CbF+30HDR/ZDBEL83Dge3Ob4GPPNkdqpTM/VFoM 86wJ+OSmuk/82UskIhCXNcez790oanW8fL8qiitc8kVpLxzFhLXWBfnDqCDpKdNKlLLH 19v2CNjvVAeJLGHXUfkgblTD4Jvj+JwphcVMEkWScWJ52IIlE/klFlLuE5FAHL68C28r T/Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nIkc3b55; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id 2-20020a251502000000b00d9cceda793esi110699ybv.41.2023.10.26.06.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 06:26:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nIkc3b55; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 1752580BD758; Thu, 26 Oct 2023 06:25:44 -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 S1344950AbjJZNZc (ORCPT + 99 others); Thu, 26 Oct 2023 09:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230479AbjJZNZa (ORCPT ); Thu, 26 Oct 2023 09:25:30 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494C4AB; Thu, 26 Oct 2023 06:25:24 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39QDNDde008548; Thu, 26 Oct 2023 13:25:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=NjrTRAfQTM5iisUaJmjdVLpMsjB19VmS9PCtPLo7muE=; b=nIkc3b55WSaabfRAK1Ci3K4hbyY7QT3yHZ1REgUZsxYx6TglyURdZiXi5ryyUnKKcmi1 nxc8hTZIiL1UdpUADWV+y7qv9Qivma3Jf5+t8+dRIoc2hlDwipb3wsJ4mt8BcGdYESiG R7GaJPboV+ssAGu/0upBWA0EUWNhT4itgMGD0clueSpC0G19WeVCRCoJyc8sT3hxPhfZ bF9cfiFTRG3lOphnkXKXWiPsMAxggyWK8vahMiIb3yQ5d5GsKdX/VhsK9QZTvfAVRbVp gTxREG+hONr1Bi1m2fl70X38cCyIi9k1VwzRU+LgWkhgNOWVRuh/OfChIsznny87rT7b oQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tyrwqr4my-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 13:25:23 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39QDNCnT008471; Thu, 26 Oct 2023 13:25:22 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 3tyrwqr4mc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 13:25:22 +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 39QCoS7Z005011; Thu, 26 Oct 2023 13:25:21 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tvtfkx30d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Oct 2023 13:25:21 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39QDPI5M13042370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Oct 2023 13:25:18 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6AC1B2004B; Thu, 26 Oct 2023 13:25:18 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25BB220040; Thu, 26 Oct 2023 13:25:18 +0000 (GMT) Received: from [9.152.224.53] (unknown [9.152.224.53]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 26 Oct 2023 13:25:18 +0000 (GMT) Message-ID: Date: Thu, 26 Oct 2023 15:25:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 1/3] s390/vfio-ap: unpin pages on gisc registration failure To: Tony Krowiak , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jjherne@linux.ibm.com, pasic@linux.ibm.com, frankja@linux.ibm.com, imbrenda@linux.ibm.com, david@redhat.com, Matthew Rosato , stable@vger.kernel.org References: <20231018133829.147226-1-akrowiak@linux.ibm.com> <20231018133829.147226-2-akrowiak@linux.ibm.com> <7ccf21c4-511c-4de6-bc02-4a936b020a10@linux.ibm.com> Content-Language: en-US From: Christian Borntraeger In-Reply-To: <7ccf21c4-511c-4de6-bc02-4a936b020a10@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: BtxKVvBEO5MH4KBQ4DdyWCsjMcoyjAa7 X-Proofpoint-ORIG-GUID: 6kuv_W9NFVvROlVXwYkVcsaKOmeINUGM 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-26_11,2023-10-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 spamscore=0 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310260114 X-Spam-Status: No, score=-4.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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]); Thu, 26 Oct 2023 06:25:44 -0700 (PDT) Am 26.10.23 um 15:16 schrieb Tony Krowiak: > > > On 10/26/23 08:18, Christian Borntraeger wrote: >> >> >> Am 18.10.23 um 15:38 schrieb Tony Krowiak: >>> From: Anthony Krowiak >>> >>> In the vfio_ap_irq_enable function, after the page containing the >>> notification indicator byte (NIB) is pinned, the function attempts >>> to register the guest ISC. If registration fails, the function sets the >>> status response code and returns without unpinning the page containing >>> the NIB. In order to avoid a memory leak, the NIB should be unpinned before >>> returning from the vfio_ap_irq_enable function. >>> >>> Signed-off-by: Janosch Frank >> >> Where is Janoschs signed off coming from here? > > Janosch found this and composed the patch originally. I just tweaked the description and posted it. So we should add Co-developed-by: Janosch Frank in front of Janoschs signoff. > >> >>> Signed-off-by: Anthony Krowiak >>> Reviewed-by: Matthew Rosato >>> Fixes: 783f0a3ccd79 ("s390/vfio-ap: add s390dbf logging to the vfio_ap_irq_enable function") >>> Cc: >>> --- >>>   drivers/s390/crypto/vfio_ap_ops.c | 1 + >>>   1 file changed, 1 insertion(+) >>> >>> diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c >>> index 4db538a55192..9cb28978c186 100644 >>> --- a/drivers/s390/crypto/vfio_ap_ops.c >>> +++ b/drivers/s390/crypto/vfio_ap_ops.c >>> @@ -457,6 +457,7 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q, >>>           VFIO_AP_DBF_WARN("%s: gisc registration failed: nisc=%d, isc=%d, apqn=%#04x\n", >>>                    __func__, nisc, isc, q->apqn); >>> +        vfio_unpin_pages(&q->matrix_mdev->vdev, nib, 1); >>>           status.response_code = AP_RESPONSE_INVALID_GISA; >>>           return status; >>>       }