All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 2/5] Revert "vfio/type1: revert "implement notify callback""
Date: Fri, 23 Oct 2026 19:53:40 +0300	[thread overview]
Message-ID: <20261023165343.503945-3-andrey.drobyshev@virtuozzo.com> (raw)
In-Reply-To: <20261023165343.503945-1-andrey.drobyshev@virtuozzo.com>

From: Anthony Yznaga <anthony.yznaga@oracle.com>

This reverts commit a5ac1f816563503eb25739ba8cc3d74548169f09.

This is needed in order to re-enable support for using VFIO_UPDATE_VADDR
with vfio mediated devices which is needed to fully support Live Update.

Orabug: 35370252
Signed-off-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>

https://virtuozzo.atlassian.net/browse/VSTOR-150595
(cherry picked from commit f18e52427b2a452dcd0cf2eee3956c039b06e329)
---
 drivers/vfio/vfio_iommu_type1.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 5167bec14e36..b2d6c68fa79c 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -75,6 +75,7 @@ struct vfio_iommu {
 	uint64_t		num_non_pinned_groups;
 	bool			v2;
 	bool			dirty_page_tracking;
+	bool			container_open;
 	struct list_head	emulated_iommu_groups;
 };
 
@@ -2645,6 +2646,7 @@ static void *vfio_iommu_type1_open(unsigned long arg)
 	INIT_LIST_HEAD(&iommu->iova_list);
 	iommu->dma_list = RB_ROOT;
 	iommu->dma_avail = dma_entry_limit;
+	iommu->container_open = true;
 	mutex_init(&iommu->lock);
 	mutex_init(&iommu->device_list_lock);
 	INIT_LIST_HEAD(&iommu->device_list);
@@ -3250,6 +3252,18 @@ vfio_iommu_type1_group_iommu_domain(void *iommu_data,
 	return domain;
 }
 
+static void vfio_iommu_type1_notify(void *iommu_data,
+				    enum vfio_iommu_notify_type event)
+{
+	struct vfio_iommu *iommu = iommu_data;
+
+	if (event != VFIO_IOMMU_CONTAINER_CLOSE)
+		return;
+	mutex_lock(&iommu->lock);
+	iommu->container_open = false;
+	mutex_unlock(&iommu->lock);
+}
+
 static const struct vfio_iommu_driver_ops vfio_iommu_driver_ops_type1 = {
 	.name			= "vfio-iommu-type1",
 	.owner			= THIS_MODULE,
@@ -3264,6 +3278,7 @@ static const struct vfio_iommu_driver_ops vfio_iommu_driver_ops_type1 = {
 	.unregister_device	= vfio_iommu_type1_unregister_device,
 	.dma_rw			= vfio_iommu_type1_dma_rw,
 	.group_iommu_domain	= vfio_iommu_type1_group_iommu_domain,
+	.notify			= vfio_iommu_type1_notify,
 };
 
 static int __init vfio_iommu_type1_init(void)
-- 
2.47.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

  parent reply	other threads:[~2026-10-23 16:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 16:53 [Devel] [PATCH hci-8.1 0/5] Support VM migration with mdev vGPUs Andrey Drobyshev
2026-10-23 16:53 ` [Devel] [PATCH hci-8.1 1/5] Revert "vfio: revert "iommu driver notify callback"" Andrey Drobyshev
2026-10-23 16:53 ` Andrey Drobyshev [this message]
2026-10-23 16:53 ` [Devel] [PATCH hci-8.1 3/5] Revert "vfio/type1: revert "block on invalid vaddr"" Andrey Drobyshev
2026-10-23 16:53 ` [Devel] [PATCH hci-8.1 4/5] Revert "vfio/type1: exclude mdevs from VFIO_UPDATE_VADDR" Andrey Drobyshev
2026-10-23 16:53 ` [Devel] [PATCH hci-8.1 5/5] mm: allow MADV_DOEXEC on a VFIO mapping not faulted in yet Andrey Drobyshev
2026-10-27 15:48 ` [Devel] [PATCH hci-8.1 0/5] Support VM migration with mdev vGPUs Andrey Drobyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261023165343.503945-3-andrey.drobyshev@virtuozzo.com \
    --to=andrey.drobyshev@virtuozzo.com \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.