Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1195880 > unrolled thread

[PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains

Started byJoerg Roedel <joro@8bytes.org>
First post2015-07-30 12:10 +0200
Last post2015-07-30 12:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains Joerg Roedel <joro@8bytes.org> - 2015-07-30 12:10 +0200
    Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains Oded Gabbay <oded.gabbay@gmail.com> - 2015-07-30 12:10 +0200
    Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains Oded Gabbay <oded.gabbay@gmail.com> - 2015-07-30 12:20 +0200

#1195880 — [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains

FromJoerg Roedel <joro@8bytes.org>
Date2015-07-30 12:10 +0200
Subject[PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
Message-ID<pRSWJ-3zB-1@gated-at.bofh.it>
From: Joerg Roedel <jroedel@suse.de>

With the grouping of multi-function devices a non-ATS
capable device might also end up in the same domain as an
IOMMUv2 capable device.
So handle this situation gracefully and don't consider it a
bug anymore.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index fa9508b..658ee39 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3318,7 +3318,12 @@ static int __flush_pasid(struct protection_domain *domain, int pasid,
 		struct amd_iommu *iommu;
 		int qdep;
 
-		BUG_ON(!dev_data->ats.enabled);
+		/*
+		   There might be non-IOMMUv2 capable devices in an IOMMUv2
+		 * domain.
+		 */
+		if (!dev_data->ats.enabled)
+			continue;
 
 		qdep  = dev_data->ats.qdep;
 		iommu = amd_iommu_rlookup_table[dev_data->devid];
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1195881

FromOded Gabbay <oded.gabbay@gmail.com>
Date2015-07-30 12:10 +0200
Message-ID<pRSWJ-3zB-3@gated-at.bofh.it>
In reply to#1195880
Joerg,
Why amdkfd's devices are considered a non-IOMMUv2 capable devices ?
After all, they contain the IOMMUv2 H/W and use it constantly for HSA.

ODed

On Thu, Jul 30, 2015 at 1:05 PM, Joerg Roedel <joro@8bytes.org> wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> With the grouping of multi-function devices a non-ATS
> capable device might also end up in the same domain as an
> IOMMUv2 capable device.
> So handle this situation gracefully and don't consider it a
> bug anymore.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  drivers/iommu/amd_iommu.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index fa9508b..658ee39 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -3318,7 +3318,12 @@ static int __flush_pasid(struct protection_domain *domain, int pasid,
>                 struct amd_iommu *iommu;
>                 int qdep;
>
> -               BUG_ON(!dev_data->ats.enabled);
> +               /*
> +                  There might be non-IOMMUv2 capable devices in an IOMMUv2
> +                * domain.
> +                */
> +               if (!dev_data->ats.enabled)
> +                       continue;
>
>                 qdep  = dev_data->ats.qdep;
>                 iommu = amd_iommu_rlookup_table[dev_data->devid];
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1195884

FromOded Gabbay <oded.gabbay@gmail.com>
Date2015-07-30 12:20 +0200
Message-ID<pRT6q-3L6-3@gated-at.bofh.it>
In reply to#1195880
On Thu, Jul 30, 2015 at 1:05 PM, Joerg Roedel <joro@8bytes.org> wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> With the grouping of multi-function devices a non-ATS
> capable device might also end up in the same domain as an
> IOMMUv2 capable device.
> So handle this situation gracefully and don't consider it a
> bug anymore.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  drivers/iommu/amd_iommu.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index fa9508b..658ee39 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -3318,7 +3318,12 @@ static int __flush_pasid(struct protection_domain *domain, int pasid,
>                 struct amd_iommu *iommu;
>                 int qdep;
>
> -               BUG_ON(!dev_data->ats.enabled);
> +               /*
> +                  There might be non-IOMMUv2 capable devices in an IOMMUv2
> +                * domain.
> +                */
> +               if (!dev_data->ats.enabled)
> +                       continue;
>
>                 qdep  = dev_data->ats.qdep;
>                 iommu = amd_iommu_rlookup_table[dev_data->devid];
> --
> 1.9.1
>
This series, with the additional patch is:
Tested-by: "Oded Gabbay <oded.gabbay@gmail.com>"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web