Message ID | 20231109164427.460493-2-akrowiak@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp580264vqs; Thu, 9 Nov 2023 09:12:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEl0/9rRjrFWyumQWJd8szdWtbrQ8YCVsyozuYm0dhpK53Mj01rC8y58U2+nWJfqRiHv2Qm X-Received: by 2002:a05:6a20:549f:b0:141:69d:8041 with SMTP id i31-20020a056a20549f00b00141069d8041mr6846464pzk.48.1699549943521; Thu, 09 Nov 2023 09:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699549943; cv=none; d=google.com; s=arc-20160816; b=TejYtGw9Yu8YaebJ0ie7ZHqcPHi+QvvZPcjmcbE6mr1i4ID5A1Sb/3HwE2J4kkGRs6 p+MKcHyYx5aOHEZ1pHka1sYmZiX++Opk5+j7IZUEJuIGl4YgG/jaG7E9XXqxUrVpv+mn KI65JL38f60/itHgCEeqT7uD12pPYssWX7kMa0neEOw2hmCvyrlWfb1Tm8fndng7OjOC ZG/Ncaf1klOHgGPuCzGdUvf7CbY0nX0rZy9UIDTkazFv0ZKl+Pyf1Hrix9oXze9RzKRf QMXHhAV+BS2UZYmujBFf4/4zqcDYBt2n/J9FTyGYnPxakTf/GElhREfLXt/yJpLg4/an GqIg== 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=nrvFh2fd1vzzeix+pUFKXs76rwQENYotxEwliyOjHjs=; fh=emmo3/Kfd2xUJtbqb1QTOeIGR+FQHlqOo9Khg9wlmK4=; b=lRN9Ml/NHzCVz0GsdtqTQ54LF4FBRfyBzTlcog343PIjaKzPGAIrpBu0Zknw1Yx56c fVyIa0W7rn48lFnW6SLzJVLWvA5SgKIsnqA2BBVSXZdnM2QvYtgj9Vrq3EQqZLi3lre2 kydVa69RPPD0BZGIurr9DuvpJycwBBj1E6kPVt4kZxTF/ODyw9hGsoiaHpuPJoxy3/jr 5IBssoVQT/yoFD6Twp8YnThsvm2DjAnvSFWr9cxrH+DnPOrxkiJKrNX0n5xzwEBquhHt u3luPOEvPg2xvLqyVszvf3vSRqa6/t7E3F4FGHclryNLp4r1EiBB6WvaHij3qbEEAXjZ pubQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mppCgzg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id d4-20020aa78684000000b006bd9ff6dab2si15059389pfo.377.2023.11.09.09.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 09:12:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mppCgzg8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A3ED58311A31; Thu, 9 Nov 2023 09:12:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234623AbjKIRLs (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 12:11:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbjKIRLr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 12:11:47 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 987AB30D0; Thu, 9 Nov 2023 09:11:45 -0800 (PST) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9HB1We032505; Thu, 9 Nov 2023 17:11:44 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=nrvFh2fd1vzzeix+pUFKXs76rwQENYotxEwliyOjHjs=; b=mppCgzg83eQqwNqBiPisYmeng6Rd5Ip0c9BpiJKQ6bDZjAhW2W7csW1bNBhltBI17phj oWnpHCyj8sBgsSRaPg+gRg8IFbqIQpK8Dn78npBRy9TpmC+bPIanqNTY29/4uozcrBoI BDSsnoM37UpOIRknqe+pLdBOfCfBSHsWCPGccPej/MuZi4vWPdN7C9ws0zfbmz1LKdqP 6skQv/8nJfqgb2wzjULi77Gz8opQgvH4ZEQro/TRbwv+YO9D5AZmnDmJqThU25eOVWKP VG3EeGXWdUvN1ptUIGifJchIl3KG2WtiKg4uP6C8+u7JpNZlcxofWDijyE3i2uiXXecR Kg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u93kh00hu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 17:11:44 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3A9GlaFI003039; Thu, 9 Nov 2023 17:04:21 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3u937fgjs1-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 17:04:21 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3A9GedSi019261; Thu, 9 Nov 2023 16:44:50 GMT Received: from smtprelay01.wdc07v.mail.ibm.com ([172.16.1.68]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3u7w2450s4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Nov 2023 16:44:50 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay01.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3A9Gin1O57737590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2023 16:44:49 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 707D858056; Thu, 9 Nov 2023 16:44:49 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7A4C58052; Thu, 9 Nov 2023 16:44:41 +0000 (GMT) Received: from li-2c1e724c-2c76-11b2-a85c-ae42eaf3cb3d.ibm.com.com (unknown [9.61.74.193]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2023 16:44:41 +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, Anthony Krowiak <akrowiak@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, stable@vger.kernel.org Subject: [PATCH v3 1/3] s390/vfio-ap: unpin pages on gisc registration failure Date: Thu, 9 Nov 2023 11:44:20 -0500 Message-ID: <20231109164427.460493-2-akrowiak@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231109164427.460493-1-akrowiak@linux.ibm.com> References: <20231109164427.460493-1-akrowiak@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OfAmeZntrcJGE9U2PyCJyHushi2tsG0K X-Proofpoint-GUID: iZzwxLJnwPbe6dLupgpxAUiVeOrS-imM 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-11-09_14,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 mlxlogscore=999 clxscore=1015 suspectscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311090130 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 (lipwig.vger.email [0.0.0.0]); Thu, 09 Nov 2023 09:12:17 -0800 (PST) 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 lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782107281709943821 X-GMAIL-MSGID: 1782107281709943821 |
Series |
s390/vfio-ap: a couple of corrections to the IRQ enablement function
|
|
Commit Message
Anthony Krowiak
Nov. 9, 2023, 4:44 p.m. UTC
From: Anthony Krowiak <akrowiak@linux.ibm.com> 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. Co-developed-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Anthony Krowiak <akrowiak@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Fixes: 783f0a3ccd79 ("s390/vfio-ap: add s390dbf logging to the vfio_ap_irq_enable function") Cc: <stable@vger.kernel.org> --- 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; }