From nobody Sun Feb 8 00:11:51 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29B3B234971; Wed, 26 Feb 2025 18:06:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740593173; cv=none; b=TQB7IQUfb0mV8+L9GKer7pIfAxvrhple9nuo/XPx/FIw4TW2fZkboWilDb+ZuPcU0NAeovFmPylKWS/0Cv+V1hz79z1J1HujPZGD0ULflqGa8f3wusJwKyNl6o7gkauhIQIa9UJrcwV4C3oDbz7Qpa6Wqm8L7Z0SZRjFWQq2ncA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740593173; c=relaxed/simple; bh=jYuDrVCIwnejG9OxLwwvZLHi34Cm0+HSAQnLAN2FIDY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IMZ0eDIzXVtkVDl7DqOnHSsyQ/FoGTZBY5alBoTk48ri304xDDybHSTah9chk8xsljzybTWzsiR3TVxbpNqp6SYPqJlGpFHRmS6u2FiSdL01/ErEqnzP49xVvbHR2lNVPJ2Oz4/SzEIJinxm1tjMqjQcsb08cjEj42S1yzNxt8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=tAE7qPR7; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="tAE7qPR7" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QDrmCU008286; Wed, 26 Feb 2025 18:06:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=Jv6Ju6jvCYWZDpsxF w375G6K0LM0i8G+SMZRC0/WaCI=; b=tAE7qPR7M4RP5Km1I84KoO+qm3CAUPcjc 8i6O8IiSlVR3sVrrHYOIQZO3tLsPH8SoOTvRV7/euo6yoJvUkoXD4c4FNcKqpI6y k2FixeHU9i1RXtMp6V/JFsmsVt10OMxJ37ZYLNwE3W7f3GOeDG4FRyBRlCGjh+IT er4rOESPxO1mXhLuCh8e4nEGth8jpnZoKDDxYCxY4UBa1QiJwMDm/ZQ0PMJLFKVc C0V5PNRe3BUvqU5W/j4QR4OxwGYnXO8stniedJL4P1CvgEZAG9LK0IINQCvIHa39 LORU6KpoJcwLsNNgDryGO18mt5jV3uZ4ySiVX/Zn28Zyx/ahd3/Og== 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 451ssym83w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Feb 2025 18:06:09 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 51QHU99F012918; Wed, 26 Feb 2025 18:06:08 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([172.16.1.6]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 44yrwsvdhu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Feb 2025 18:06:08 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 51QI676m31261216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Feb 2025 18:06:07 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0D705805A; Wed, 26 Feb 2025 18:06:07 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0327A58056; Wed, 26 Feb 2025 18:06:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.248.9]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 26 Feb 2025 18:06:06 +0000 (GMT) From: Rorie Reyes To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: hca@linux.ibm.com, borntraeger@de.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com, pasic@linux.ibm.com, jjherne@linux.ibm.com, alex.williamson@redhat.com, akrowiak@linux.ibm.com, rreyes@linux.ibm.com Subject: [RFC PATCH v3 1/2] s390/vfio-ap: Signal eventfd when guest AP configuration is changed Date: Wed, 26 Feb 2025 13:06:04 -0500 Message-ID: <20250226180605.15810-2-rreyes@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250226180605.15810-1-rreyes@linux.ibm.com> References: <20250226180605.15810-1-rreyes@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: RQKWeTwH61Mfbx3G-ioRoLPvub_n7fiR X-Proofpoint-GUID: RQKWeTwH61Mfbx3G-ioRoLPvub_n7fiR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_04,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502260142 Content-Type: text/plain; charset="utf-8" In this patch, an eventfd object is created by the vfio_ap device driver and used to notify userspace when a guests's AP configuration is dynamically changed. Such changes may occur whenever: * An adapter, domain or control domain is assigned to or unassigned from a mediated device that is attached to the guest. * A queue assigned to the mediated device that is attached to a guest is bound to or unbound from the vfio_ap device driver. This can occur either by manually binding/unbinding the queue via the vfio_ap driver's sysfs bind/unbind attribute interfaces, or because an adapter, domain or control domain assigned to the mediated device is added to or removed from the host's AP configuration via an SE/HMC Signed-off-by: Rorie Reyes Reviewed-by: Anthony Krowiak Tested-by: Anthony Krowiak --- drivers/s390/crypto/vfio_ap_ops.c | 51 ++++++++++++++++++++++++++- drivers/s390/crypto/vfio_ap_private.h | 2 ++ include/uapi/linux/vfio.h | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_a= p_ops.c index a52c2690933f..9a6845064ff3 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -650,13 +650,22 @@ static void vfio_ap_matrix_init(struct ap_config_info= *info, matrix->adm_max =3D info->apxa ? info->nd : 15; } =20 +static void signal_guest_ap_cfg_changed(struct ap_matrix_mdev *matrix_mdev) +{ + if (matrix_mdev->cfg_chg_trigger) + eventfd_signal(matrix_mdev->cfg_chg_trigger); +} + static void vfio_ap_mdev_update_guest_apcb(struct ap_matrix_mdev *matrix_m= dev) { - if (matrix_mdev->kvm) + if (matrix_mdev->kvm) { kvm_arch_crypto_set_masks(matrix_mdev->kvm, matrix_mdev->shadow_apcb.apm, matrix_mdev->shadow_apcb.aqm, matrix_mdev->shadow_apcb.adm); + + signal_guest_ap_cfg_changed(matrix_mdev); + } } =20 static bool vfio_ap_mdev_filter_cdoms(struct ap_matrix_mdev *matrix_mdev) @@ -792,6 +801,7 @@ static int vfio_ap_mdev_probe(struct mdev_device *mdev) if (ret) goto err_put_vdev; matrix_mdev->req_trigger =3D NULL; + matrix_mdev->cfg_chg_trigger =3D NULL; dev_set_drvdata(&mdev->dev, matrix_mdev); mutex_lock(&matrix_dev->mdevs_lock); list_add(&matrix_mdev->node, &matrix_dev->mdev_list); @@ -2097,6 +2107,10 @@ static ssize_t vfio_ap_get_irq_info(unsigned long ar= g) info.count =3D 1; info.flags =3D VFIO_IRQ_INFO_EVENTFD; break; + case VFIO_AP_CFG_CHG_IRQ_INDEX: + info.count =3D 1; + info.flags =3D VFIO_IRQ_INFO_EVENTFD; + break; default: return -EINVAL; } @@ -2160,6 +2174,39 @@ static int vfio_ap_set_request_irq(struct ap_matrix_= mdev *matrix_mdev, return 0; } =20 +static int vfio_ap_set_cfg_change_irq(struct ap_matrix_mdev *matrix_mdev, = unsigned long arg) +{ + s32 fd; + void __user *data; + unsigned long minsz; + struct eventfd_ctx *cfg_chg_trigger; + + minsz =3D offsetofend(struct vfio_irq_set, count); + data =3D (void __user *)(arg + minsz); + + if (get_user(fd, (s32 __user *)data)) + return -EFAULT; + + if (fd =3D=3D -1) { + if (matrix_mdev->cfg_chg_trigger) + eventfd_ctx_put(matrix_mdev->cfg_chg_trigger); + matrix_mdev->cfg_chg_trigger =3D NULL; + } else if (fd >=3D 0) { + cfg_chg_trigger =3D eventfd_ctx_fdget(fd); + if (IS_ERR(cfg_chg_trigger)) + return PTR_ERR(cfg_chg_trigger); + + if (matrix_mdev->cfg_chg_trigger) + eventfd_ctx_put(matrix_mdev->cfg_chg_trigger); + + matrix_mdev->cfg_chg_trigger =3D cfg_chg_trigger; + } else { + return -EINVAL; + } + + return 0; +} + static int vfio_ap_set_irqs(struct ap_matrix_mdev *matrix_mdev, unsigned long arg) { @@ -2175,6 +2222,8 @@ static int vfio_ap_set_irqs(struct ap_matrix_mdev *ma= trix_mdev, switch (irq_set.index) { case VFIO_AP_REQ_IRQ_INDEX: return vfio_ap_set_request_irq(matrix_mdev, arg); + case VFIO_AP_CFG_CHG_IRQ_INDEX: + return vfio_ap_set_cfg_change_irq(matrix_mdev, arg); default: return -EINVAL; } diff --git a/drivers/s390/crypto/vfio_ap_private.h b/drivers/s390/crypto/vf= io_ap_private.h index 437a161c8659..37de9c69b6eb 100644 --- a/drivers/s390/crypto/vfio_ap_private.h +++ b/drivers/s390/crypto/vfio_ap_private.h @@ -105,6 +105,7 @@ struct ap_queue_table { * @mdev: the mediated device * @qtable: table of queues (struct vfio_ap_queue) assigned to the mdev * @req_trigger eventfd ctx for signaling userspace to return a device + * @cfg_chg_trigger eventfd ctx to signal AP config changed to userspace * @apm_add: bitmap of APIDs added to the host's AP configuration * @aqm_add: bitmap of APQIs added to the host's AP configuration * @adm_add: bitmap of control domain numbers added to the host's AP @@ -120,6 +121,7 @@ struct ap_matrix_mdev { struct mdev_device *mdev; struct ap_queue_table qtable; struct eventfd_ctx *req_trigger; + struct eventfd_ctx *cfg_chg_trigger; DECLARE_BITMAP(apm_add, AP_DEVICES); DECLARE_BITMAP(aqm_add, AP_DOMAINS); DECLARE_BITMAP(adm_add, AP_DOMAINS); diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index c8dbf8219c4f..a2d3e1ac6239 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -671,6 +671,7 @@ enum { */ enum { VFIO_AP_REQ_IRQ_INDEX, + VFIO_AP_CFG_CHG_IRQ_INDEX, VFIO_AP_NUM_IRQS }; =20 --=20 2.48.1 From nobody Sun Feb 8 00:11:51 2026 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A3F123E23C; Wed, 26 Feb 2025 18:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740593178; cv=none; b=HEUzoSs4oAridy7mrtmrKBFH5S6ar2RuJX4sM3Z5l8UwW+LfT2fTG/jXLpAfDMk8MCwZuWoHoYXIE1ZuCL5/cHavUM00oJro28gD7Exh1y232y6pNn+1XffIRofJYHXHKl+2kLubFBSt2NU7cgp6DJVBqXMQCL0W1f3QKnFVtfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740593178; c=relaxed/simple; bh=E8Ecymq8CBrhz4/hOFJWe+WkF4M7ObE/VCe/8ADPU6w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VnX7eq7IAno21RF/yfROsXM3I9qAbU21uKrcJRBOciDRR9Xq7kcCTwsz9NOsDnd4AP4opN6Ijh6hKtCZaCq35KL7UJwlepHpcC4fiOxBVv171XAcvEwdyspA83wFxpnVAS+vLLg5LtcT2e8BF4832/UB5OVL3T1gQmOxQoXkYdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=dGnsdQaP; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="dGnsdQaP" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 51QBGEuZ027849; Wed, 26 Feb 2025 18:06:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=h6zpg6zC5z/rQVzpN 2FehhGN502lUYMO052KpWM4Tjw=; b=dGnsdQaPH2q/esiRJelYW50b2CveRM4d0 5ECq6+vtgrHTi8USndDV+Tf4mD1zk97/UumzqqZQQ4Nq+EjhTg+WWZSL/ZyTiOU0 WqOmRysuEeUyncMg7wwhCVcY4qPz4avEHlLqD7rslvBnQWJxAI89mxiXxKnQVZ9F o47YguClcXRl8PIZ4PUzVaDtQEQONqv7dp0rqH7A0cUW0mw7CdDT4j37vlyckjv6 6paGHCzRi2VSZ/J2PnS7k+i6RD787VcwIVUxhgWDKcs8h+racEBWae4S1mf/Jtc+ laCUTbr/Sw7DWW/ZsVeno2v7rzZzA3xtp6Mph+NLSZwni6uDQB2bg== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 451q5jcx27-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Feb 2025 18:06:11 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 51QFKW6j026269; Wed, 26 Feb 2025 18:06:10 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 44yswnm53f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Feb 2025 18:06:09 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 51QI68ae30737044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Feb 2025 18:06:08 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5CF75805A; Wed, 26 Feb 2025 18:06:08 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA3D258056; Wed, 26 Feb 2025 18:06:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.61.248.9]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 26 Feb 2025 18:06:07 +0000 (GMT) From: Rorie Reyes To: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: hca@linux.ibm.com, borntraeger@de.ibm.com, agordeev@linux.ibm.com, gor@linux.ibm.com, pasic@linux.ibm.com, jjherne@linux.ibm.com, alex.williamson@redhat.com, akrowiak@linux.ibm.com, rreyes@linux.ibm.com Subject: [RFC PATCH v3 2/2] s390/vfio-ap: Adding mdev remove notification Date: Wed, 26 Feb 2025 13:06:05 -0500 Message-ID: <20250226180605.15810-3-rreyes@linux.ibm.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250226180605.15810-1-rreyes@linux.ibm.com> References: <20250226180605.15810-1-rreyes@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ffL4sV97Vb7PfKd_zhlD1KQ9f-70t_7w X-Proofpoint-ORIG-GUID: ffL4sV97Vb7PfKd_zhlD1KQ9f-70t_7w X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-02-26_04,2025-02-26_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 phishscore=0 adultscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2502260142 Content-Type: text/plain; charset="utf-8" This patch is based on the s390/features branch. The first patch, b26ed71f9647, was missing a notification based on the process to remove a mediated device from the AP configuration. In the original patch, b26ed71f9647, the guest is notified immediately for any AP configuration changes that are queued during the following processes: - assign/unassign_adapter - assign/unassign_domain - bind/unbind However, the original patch, b26ed71f9647, was missing a notification for the process to remove the entire mediated device. This patch addresses the missing notification and successfully notifies the guest when a mediated device is removed. Notes: - Removed eventfd from vfio_ap_mdev_unset_kvm - Update and release locks along with the eventfd added to vfio_ap_mdev_request Signed-off-by: Rorie Reyes --- drivers/s390/crypto/vfio_ap_ops.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_a= p_ops.c index 9a6845064ff3..e0237ea27d7e 100644 --- a/drivers/s390/crypto/vfio_ap_ops.c +++ b/drivers/s390/crypto/vfio_ap_ops.c @@ -2056,6 +2056,14 @@ static void vfio_ap_mdev_request(struct vfio_device = *vdev, unsigned int count) =20 matrix_mdev =3D container_of(vdev, struct ap_matrix_mdev, vdev); =20 + if (matrix_mdev->kvm) { + get_update_locks_for_kvm(matrix_mdev->kvm); + kvm_arch_crypto_clear_masks(matrix_mdev->kvm); + signal_guest_ap_cfg_changed(matrix_mdev); + } else { + mutex_lock(&matrix_dev->mdevs_lock); + } + if (matrix_mdev->req_trigger) { if (!(count % 10)) dev_notice_ratelimited(dev, @@ -2067,6 +2075,12 @@ static void vfio_ap_mdev_request(struct vfio_device = *vdev, unsigned int count) dev_notice(dev, "No device request registered, blocked until released by user\n"); } + + if (matrix_mdev->kvm) + release_update_locks_for_kvm(matrix_mdev->kvm); + else + mutex_unlock(&matrix_dev->mdevs_lock); + } =20 static int vfio_ap_mdev_get_device_info(unsigned long arg) --=20 2.48.1