All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
@ 2015-07-30 10:05 ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2015-07-30 10:05 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Joerg Roedel, linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>

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-l3A5Bk7waGM@public.gmane.org>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
@ 2015-07-30 10:05 ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2015-07-30 10:05 UTC (permalink / raw)
  To: iommu; +Cc: linux-kernel, Oded Gabbay, Joerg Roedel

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
  2015-07-30 10:05 ` Joerg Roedel
@ 2015-07-30 10:08     ` Oded Gabbay
  -1 siblings, 0 replies; 8+ messages in thread
From: Oded Gabbay @ 2015-07-30 10:08 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Joerg Roedel,
	Linux-Kernel@Vger. Kernel. Org

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-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> wrote:
> From: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
>
> 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-l3A5Bk7waGM@public.gmane.org>
> ---
>  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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
@ 2015-07-30 10:08     ` Oded Gabbay
  0 siblings, 0 replies; 8+ messages in thread
From: Oded Gabbay @ 2015-07-30 10:08 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, Linux-Kernel@Vger. Kernel. Org, Joerg Roedel

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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
  2015-07-30 10:05 ` Joerg Roedel
@ 2015-07-30 10:11     ` Oded Gabbay
  -1 siblings, 0 replies; 8+ messages in thread
From: Oded Gabbay @ 2015-07-30 10:11 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Joerg Roedel,
	Linux-Kernel@Vger. Kernel. Org

On Thu, Jul 30, 2015 at 1:05 PM, Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> wrote:
> From: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>
>
> 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-l3A5Bk7waGM@public.gmane.org>
> ---
>  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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
@ 2015-07-30 10:11     ` Oded Gabbay
  0 siblings, 0 replies; 8+ messages in thread
From: Oded Gabbay @ 2015-07-30 10:11 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, Linux-Kernel@Vger. Kernel. Org, Joerg Roedel

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>"

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
  2015-07-30 10:08     ` Oded Gabbay
@ 2015-07-30 11:24         ` Joerg Roedel
  -1 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2015-07-30 11:24 UTC (permalink / raw)
  To: Oded Gabbay
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Linux-Kernel@Vger. Kernel. Org

Hi Oded,

On Thu, Jul 30, 2015 at 01:08:46PM +0300, Oded Gabbay wrote:
> 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.

With 4.2 the AMD IOMMU driver relies on iommu groups from the iommu core
code. With that, all functions of a multi-function device will be in one
group (and have to be in one domain). This means that the audio device
which comes with every HSA GPU is in the same group, and this device
lacks the IOMMUv2 features.


	Joerg

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains
@ 2015-07-30 11:24         ` Joerg Roedel
  0 siblings, 0 replies; 8+ messages in thread
From: Joerg Roedel @ 2015-07-30 11:24 UTC (permalink / raw)
  To: Oded Gabbay; +Cc: Joerg Roedel, iommu, Linux-Kernel@Vger. Kernel. Org

Hi Oded,

On Thu, Jul 30, 2015 at 01:08:46PM +0300, Oded Gabbay wrote:
> 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.

With 4.2 the AMD IOMMU driver relies on iommu groups from the iommu core
code. With that, all functions of a multi-function device will be in one
group (and have to be in one domain). This means that the audio device
which comes with every HSA GPU is in the same group, and this device
lacks the IOMMUv2 features.


	Joerg


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-30 11:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-30 10:05 [PATCH] iommu/amd: Allow non-ATS devices in IOMMUv2 domains Joerg Roedel
2015-07-30 10:05 ` Joerg Roedel
     [not found] ` <1438250724-4443-1-git-send-email-joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2015-07-30 10:08   ` Oded Gabbay
2015-07-30 10:08     ` Oded Gabbay
     [not found]     ` <CAFCwf12=3VrHX2M4n8TeV=gkD+-V=_2x4muiozdb39S0A6BmRg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-30 11:24       ` Joerg Roedel
2015-07-30 11:24         ` Joerg Roedel
2015-07-30 10:11   ` Oded Gabbay
2015-07-30 10:11     ` Oded Gabbay

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.