From: Robin Murphy <robin.murphy@arm.com> To: alex.williamson@redhat.com, cohuck@redhat.com Cc: kvm@vger.kernel.org, iommu@lists.linux.dev, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, jgg@nvidia.com Subject: [PATCH v2 2/2] vfio: Use device_iommu_capable() Date: Wed, 22 Jun 2022 13:04:12 +0100 [thread overview] Message-ID: <910aef11138e3b6702b29a3e78415235aa4bf773.1655898523.git.robin.murphy@arm.com> (raw) In-Reply-To: <b1d13cade281a7d8acbfd0f6a33dcd086207952c.1655898523.git.robin.murphy@arm.com> Use the new interface to check the capabilities for our device specifically. Signed-off-by: Robin Murphy <robin.murphy@arm.com> --- drivers/vfio/vfio.c | 2 +- drivers/vfio/vfio_iommu_type1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 73bab04880d0..765d68192c88 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -621,7 +621,7 @@ int vfio_register_group_dev(struct vfio_device *device) * VFIO always sets IOMMU_CACHE because we offer no way for userspace to * restore cache coherency. */ - if (!iommu_capable(device->dev->bus, IOMMU_CAP_CACHE_COHERENCY)) + if (!device_iommu_capable(device->dev, IOMMU_CAP_CACHE_COHERENCY)) return -EINVAL; return __vfio_register_dev(device, diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index e38b8bfde677..2107e95eb743 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -2247,7 +2247,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, list_add(&group->next, &domain->group_list); msi_remap = irq_domain_check_msi_remap() || - iommu_capable(iommu_api_dev->dev->bus, IOMMU_CAP_INTR_REMAP); + device_iommu_capable(iommu_api_dev->dev, IOMMU_CAP_INTR_REMAP); if (!allow_unsafe_interrupts && !msi_remap) { pr_warn("%s: No interrupt remapping support. Use the module param \"allow_unsafe_interrupts\" to enable VFIO IOMMU support on this platform\n", -- 2.36.1.dirty
WARNING: multiple messages have this Message-ID (diff)
From: Robin Murphy <robin.murphy@arm.com> To: alex.williamson@redhat.com, cohuck@redhat.com Cc: jgg@nvidia.com, iommu@lists.linux.dev, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] vfio: Use device_iommu_capable() Date: Wed, 22 Jun 2022 13:04:12 +0100 [thread overview] Message-ID: <910aef11138e3b6702b29a3e78415235aa4bf773.1655898523.git.robin.murphy@arm.com> (raw) In-Reply-To: <b1d13cade281a7d8acbfd0f6a33dcd086207952c.1655898523.git.robin.murphy@arm.com> Use the new interface to check the capabilities for our device specifically. Signed-off-by: Robin Murphy <robin.murphy@arm.com> --- drivers/vfio/vfio.c | 2 +- drivers/vfio/vfio_iommu_type1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 73bab04880d0..765d68192c88 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -621,7 +621,7 @@ int vfio_register_group_dev(struct vfio_device *device) * VFIO always sets IOMMU_CACHE because we offer no way for userspace to * restore cache coherency. */ - if (!iommu_capable(device->dev->bus, IOMMU_CAP_CACHE_COHERENCY)) + if (!device_iommu_capable(device->dev, IOMMU_CAP_CACHE_COHERENCY)) return -EINVAL; return __vfio_register_dev(device, diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index e38b8bfde677..2107e95eb743 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -2247,7 +2247,7 @@ static int vfio_iommu_type1_attach_group(void *iommu_data, list_add(&group->next, &domain->group_list); msi_remap = irq_domain_check_msi_remap() || - iommu_capable(iommu_api_dev->dev->bus, IOMMU_CAP_INTR_REMAP); + device_iommu_capable(iommu_api_dev->dev, IOMMU_CAP_INTR_REMAP); if (!allow_unsafe_interrupts && !msi_remap) { pr_warn("%s: No interrupt remapping support. Use the module param \"allow_unsafe_interrupts\" to enable VFIO IOMMU support on this platform\n", -- 2.36.1.dirty _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2022-06-22 12:04 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-22 12:04 [PATCH v2 1/2] vfio/type1: Simplify bus_type determination Robin Murphy 2022-06-22 12:04 ` Robin Murphy 2022-06-22 12:04 ` Robin Murphy [this message] 2022-06-22 12:04 ` [PATCH v2 2/2] vfio: Use device_iommu_capable() Robin Murphy 2022-06-23 1:47 ` Baolu Lu 2022-06-23 1:47 ` Baolu Lu 2022-06-22 22:17 ` [PATCH v2 1/2] vfio/type1: Simplify bus_type determination Alex Williamson 2022-06-22 22:17 ` Alex Williamson 2022-06-23 8:46 ` Tian, Kevin 2022-06-23 8:46 ` Tian, Kevin 2022-06-23 20:35 ` Alex Williamson 2022-06-23 20:35 ` Alex Williamson 2022-06-23 12:23 ` Robin Murphy 2022-06-23 12:23 ` Robin Murphy 2022-06-23 20:50 ` Jason Gunthorpe 2022-06-23 20:50 ` Jason Gunthorpe via iommu 2022-06-23 23:00 ` Alex Williamson 2022-06-23 23:00 ` Alex Williamson 2022-06-24 1:50 ` Jason Gunthorpe 2022-06-24 1:50 ` Jason Gunthorpe via iommu 2022-06-24 14:11 ` Alex Williamson 2022-06-24 14:11 ` Alex Williamson 2022-06-24 14:18 ` Jason Gunthorpe 2022-06-24 14:18 ` Jason Gunthorpe via iommu 2022-06-24 14:28 ` Alex Williamson 2022-06-24 14:28 ` Alex Williamson 2022-06-24 14:56 ` Jason Gunthorpe via iommu 2022-06-24 14:56 ` Jason Gunthorpe 2022-06-24 15:12 ` Robin Murphy 2022-06-24 15:12 ` Robin Murphy 2022-06-24 16:04 ` Alex Williamson 2022-06-24 16:04 ` Alex Williamson 2022-06-23 1:46 ` Baolu Lu 2022-06-23 1:46 ` Baolu Lu 2022-06-23 4:32 ` kernel test robot 2022-06-23 4:32 ` kernel test robot 2022-06-24 1:52 ` Jason Gunthorpe 2022-06-24 1:52 ` Jason Gunthorpe via iommu
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=910aef11138e3b6702b29a3e78415235aa4bf773.1655898523.git.robin.murphy@arm.com \ --to=robin.murphy@arm.com \ --cc=alex.williamson@redhat.com \ --cc=cohuck@redhat.com \ --cc=iommu@lists.linux-foundation.org \ --cc=iommu@lists.linux.dev \ --cc=jgg@nvidia.com \ --cc=kvm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.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: linkBe 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.