All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: alex.williamson@redhat.com, pbonzini@redhat.com,
	yi.l.liu@intel.com, jgg@nvidia.com
Cc: cohuck@redhat.com, farman@linux.ibm.com, pmorel@linux.ibm.com,
	borntraeger@linux.ibm.com, frankja@linux.ibm.com,
	imbrenda@linux.ibm.com, david@redhat.com, akrowiak@linux.ibm.com,
	jjherne@linux.ibm.com, pasic@linux.ibm.com,
	zhenyuw@linux.intel.com, zhi.a.wang@intel.com, seanjc@google.com,
	kevin.tian@intel.com, linux-s390@vger.kernel.org,
	kvm@vger.kernel.org, intel-gvt-dev@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/2] vfio: no need to pass kvm pointer during device open
Date: Fri,  3 Feb 2023 16:50:27 -0500	[thread overview]
Message-ID: <20230203215027.151988-3-mjrosato@linux.ibm.com> (raw)
In-Reply-To: <20230203215027.151988-1-mjrosato@linux.ibm.com>

Nothing uses this value during vfio_device_open anymore so it's safe
to remove it.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
---
 drivers/vfio/group.c     | 2 +-
 drivers/vfio/vfio.h      | 3 +--
 drivers/vfio/vfio_main.c | 7 +++----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
index 98621ac082f0..0e9036e2b9c4 100644
--- a/drivers/vfio/group.c
+++ b/drivers/vfio/group.c
@@ -187,7 +187,7 @@ static int vfio_device_group_open(struct vfio_device *device)
 	if (device->open_count == 0)
 		vfio_device_group_get_kvm_safe(device);
 
-	ret = vfio_device_open(device, device->group->iommufd, device->kvm);
+	ret = vfio_device_open(device, device->group->iommufd);
 
 	if (device->open_count == 0)
 		vfio_device_put_kvm(device);
diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h
index 24d6cd285945..4f39ab549a80 100644
--- a/drivers/vfio/vfio.h
+++ b/drivers/vfio/vfio.h
@@ -18,8 +18,7 @@ struct vfio_container;
 
 void vfio_device_put_registration(struct vfio_device *device);
 bool vfio_device_try_get_registration(struct vfio_device *device);
-int vfio_device_open(struct vfio_device *device,
-		     struct iommufd_ctx *iommufd, struct kvm *kvm);
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd);
 void vfio_device_close(struct vfio_device *device,
 		       struct iommufd_ctx *iommufd);
 
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c
index 28c47cd6a6b5..3a597e799918 100644
--- a/drivers/vfio/vfio_main.c
+++ b/drivers/vfio/vfio_main.c
@@ -397,7 +397,7 @@ static bool vfio_assert_device_open(struct vfio_device *device)
 }
 
 static int vfio_device_first_open(struct vfio_device *device,
-				  struct iommufd_ctx *iommufd, struct kvm *kvm)
+				  struct iommufd_ctx *iommufd)
 {
 	int ret;
 
@@ -444,8 +444,7 @@ static void vfio_device_last_close(struct vfio_device *device,
 	module_put(device->dev->driver->owner);
 }
 
-int vfio_device_open(struct vfio_device *device,
-		     struct iommufd_ctx *iommufd, struct kvm *kvm)
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd)
 {
 	int ret = 0;
 
@@ -453,7 +452,7 @@ int vfio_device_open(struct vfio_device *device,
 
 	device->open_count++;
 	if (device->open_count == 1) {
-		ret = vfio_device_first_open(device, iommufd, kvm);
+		ret = vfio_device_first_open(device, iommufd);
 		if (ret)
 			device->open_count--;
 	}
-- 
2.39.1


WARNING: multiple messages have this Message-ID (diff)
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: alex.williamson@redhat.com, pbonzini@redhat.com,
	yi.l.liu@intel.com, jgg@nvidia.com
Cc: akrowiak@linux.ibm.com, jjherne@linux.ibm.com,
	farman@linux.ibm.com, borntraeger@linux.ibm.com,
	frankja@linux.ibm.com, pmorel@linux.ibm.com, david@redhat.com,
	seanjc@google.com, intel-gfx@lists.freedesktop.org,
	cohuck@redhat.com, linux-kernel@vger.kernel.org,
	pasic@linux.ibm.com, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	intel-gvt-dev@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v4 2/2] vfio: no need to pass kvm pointer during device open
Date: Fri,  3 Feb 2023 16:50:27 -0500	[thread overview]
Message-ID: <20230203215027.151988-3-mjrosato@linux.ibm.com> (raw)
In-Reply-To: <20230203215027.151988-1-mjrosato@linux.ibm.com>

Nothing uses this value during vfio_device_open anymore so it's safe
to remove it.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
---
 drivers/vfio/group.c     | 2 +-
 drivers/vfio/vfio.h      | 3 +--
 drivers/vfio/vfio_main.c | 7 +++----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
index 98621ac082f0..0e9036e2b9c4 100644
--- a/drivers/vfio/group.c
+++ b/drivers/vfio/group.c
@@ -187,7 +187,7 @@ static int vfio_device_group_open(struct vfio_device *device)
 	if (device->open_count == 0)
 		vfio_device_group_get_kvm_safe(device);
 
-	ret = vfio_device_open(device, device->group->iommufd, device->kvm);
+	ret = vfio_device_open(device, device->group->iommufd);
 
 	if (device->open_count == 0)
 		vfio_device_put_kvm(device);
diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h
index 24d6cd285945..4f39ab549a80 100644
--- a/drivers/vfio/vfio.h
+++ b/drivers/vfio/vfio.h
@@ -18,8 +18,7 @@ struct vfio_container;
 
 void vfio_device_put_registration(struct vfio_device *device);
 bool vfio_device_try_get_registration(struct vfio_device *device);
-int vfio_device_open(struct vfio_device *device,
-		     struct iommufd_ctx *iommufd, struct kvm *kvm);
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd);
 void vfio_device_close(struct vfio_device *device,
 		       struct iommufd_ctx *iommufd);
 
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c
index 28c47cd6a6b5..3a597e799918 100644
--- a/drivers/vfio/vfio_main.c
+++ b/drivers/vfio/vfio_main.c
@@ -397,7 +397,7 @@ static bool vfio_assert_device_open(struct vfio_device *device)
 }
 
 static int vfio_device_first_open(struct vfio_device *device,
-				  struct iommufd_ctx *iommufd, struct kvm *kvm)
+				  struct iommufd_ctx *iommufd)
 {
 	int ret;
 
@@ -444,8 +444,7 @@ static void vfio_device_last_close(struct vfio_device *device,
 	module_put(device->dev->driver->owner);
 }
 
-int vfio_device_open(struct vfio_device *device,
-		     struct iommufd_ctx *iommufd, struct kvm *kvm)
+int vfio_device_open(struct vfio_device *device, struct iommufd_ctx *iommufd)
 {
 	int ret = 0;
 
@@ -453,7 +452,7 @@ int vfio_device_open(struct vfio_device *device,
 
 	device->open_count++;
 	if (device->open_count == 1) {
-		ret = vfio_device_first_open(device, iommufd, kvm);
+		ret = vfio_device_first_open(device, iommufd);
 		if (ret)
 			device->open_count--;
 	}
-- 
2.39.1


  parent reply	other threads:[~2023-02-03 21:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 21:50 [PATCH v4 0/2] vfio: fix deadlock between group lock and kvm lock Matthew Rosato
2023-02-03 21:50 ` [Intel-gfx] " Matthew Rosato
2023-02-03 21:50 ` [PATCH v4 1/2] " Matthew Rosato
2023-02-03 21:50   ` [Intel-gfx] " Matthew Rosato
2023-02-04  6:21   ` Liu, Yi L
2023-02-04  6:21     ` [Intel-gfx] " Liu, Yi L
2023-02-04 14:25     ` Alex Williamson
2023-02-04 14:25       ` Alex Williamson
2023-02-06  3:52   ` Tian, Kevin
2023-02-06  3:52     ` [Intel-gfx] " Tian, Kevin
2023-02-06 14:30   ` Anthony Krowiak
2023-02-06 14:30     ` [Intel-gfx] " Anthony Krowiak
2023-02-03 21:50 ` Matthew Rosato [this message]
2023-02-03 21:50   ` [Intel-gfx] [PATCH v4 2/2] vfio: no need to pass kvm pointer during device open Matthew Rosato
2023-02-04  6:23   ` Liu, Yi L
2023-02-04  6:23     ` [Intel-gfx] " Liu, Yi L
2023-02-06  3:53   ` Tian, Kevin
2023-02-06  3:53     ` Tian, Kevin
2023-02-06 14:30   ` Anthony Krowiak
2023-02-06 14:30     ` [Intel-gfx] " Anthony Krowiak
2023-02-03 22:22 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for vfio: fix deadlock between group lock and kvm lock (rev8) Patchwork
2023-02-03 22:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-05  9:48 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-02-09 21:03 ` [PATCH v4 0/2] vfio: fix deadlock between group lock and kvm lock Alex Williamson
2023-02-09 21:03   ` [Intel-gfx] " Alex Williamson

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=20230203215027.151988-3-mjrosato@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jgg@nvidia.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=pmorel@linux.ibm.com \
    --cc=seanjc@google.com \
    --cc=yi.l.liu@intel.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.com \
    /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.