diff mbox series

[iommufd,v3,4/9] iommufd: Convert to msi_device_has_isolated_msi()

Message ID 4-v3-3313bb5dd3a3+10f11-secure_msi_jgg@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Remove IOMMU_CAP_INTR_REMAP | expand

Commit Message

Jason Gunthorpe Jan. 5, 2023, 7:33 p.m. UTC
Trivially use the new API.

Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommufd/device.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Baolu Lu Jan. 6, 2023, 11:36 a.m. UTC | #1
On 1/6/2023 3:33 AM, Jason Gunthorpe wrote:
> Trivially use the new API.
>
> Tested-by: Matthew Rosato<mjrosato@linux.ibm.com>
> Reviewed-by: Kevin Tian<kevin.tian@intel.com>
> Signed-off-by: Jason Gunthorpe<jgg@nvidia.com>
> ---
>   drivers/iommu/iommufd/device.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
> index d81f93a321afcb..9f3b9674d72e81 100644
> --- a/drivers/iommu/iommufd/device.c
> +++ b/drivers/iommu/iommufd/device.c
> @@ -4,7 +4,6 @@
>   #include <linux/iommufd.h>
>   #include <linux/slab.h>
>   #include <linux/iommu.h>
> -#include <linux/irqdomain.h>
>   
>   #include "io_pagetable.h"
>   #include "iommufd_private.h"
> @@ -169,8 +168,7 @@ static int iommufd_device_setup_msi(struct iommufd_device *idev,
>   	 * operation from the device (eg a simple DMA) cannot trigger an
>   	 * interrupt outside this iommufd context.
>   	 */
> -	if (!device_iommu_capable(idev->dev, IOMMU_CAP_INTR_REMAP) &&
> -	    !irq_domain_check_msi_remap()) {
> +	if (!iommu_group_has_isolated_msi(idev->group)) {
>   		if (!allow_unsafe_interrupts)
>   			return -EPERM;

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

--

Best regards,

baolu
diff mbox series

Patch

diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index d81f93a321afcb..9f3b9674d72e81 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -4,7 +4,6 @@ 
 #include <linux/iommufd.h>
 #include <linux/slab.h>
 #include <linux/iommu.h>
-#include <linux/irqdomain.h>
 
 #include "io_pagetable.h"
 #include "iommufd_private.h"
@@ -169,8 +168,7 @@  static int iommufd_device_setup_msi(struct iommufd_device *idev,
 	 * operation from the device (eg a simple DMA) cannot trigger an
 	 * interrupt outside this iommufd context.
 	 */
-	if (!device_iommu_capable(idev->dev, IOMMU_CAP_INTR_REMAP) &&
-	    !irq_domain_check_msi_remap()) {
+	if (!iommu_group_has_isolated_msi(idev->group)) {
 		if (!allow_unsafe_interrupts)
 			return -EPERM;