All of lore.kernel.org
 help / color / mirror / Atom feed
* amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
@ 2017-03-13 19:49 Daniel Drake
       [not found] ` <CAD8Lp457TE1CnJ-DHnB6NB2LWxgA5K5K57Q6L7XcSHeYNpvARQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Daniel Drake @ 2017-03-13 19:49 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: Chris Chiu, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Linux Upstreaming Team, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi,

We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
Acer Aspire E5-523 with standard configurations because during boot
the screen is flooded with the following error message over and over:

  AMD-Vi: Completion-Wait loop timed out

We have left the system for quite a while but the message spam does
not stop and the system doesn't complete the boot sequence.

We have reproduced on Linux 4.8 and Linux 4.10.

To avoid this, we can boot with iommu=soft or just disable the amdgpu
display driver.

Looks like this may also affect HP 15-ba012no :
https://bugzilla.redhat.com/show_bug.cgi?id=1409201

Earlier during boot the iommu is detected as:

[    1.274518] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
[    1.274519] AMD-Vi: Extended features (0x37ef22294ada):
[    1.274519]  PPR NX GT IA GA PC GA_vAPIC
[    1.274523] AMD-Vi: Interrupt remapping enabled
[    1.274523] AMD-Vi: virtual APIC enabled
[    1.275144] AMD-Vi: Lazy IO/TLB flushing enabled
[    1.276498] perf: AMD NB counters detected
[    1.278096] LVT offset 0 assigned for vector 0x400
[    1.278963] perf: AMD IBS detected (0x000007ff)
[    1.278977] perf: amd_iommu: Detected. (0 banks, 0 counters/bank)

Any suggestions for how we can fix this, or get more useful debug info?

Thanks
Daniel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found] ` <CAD8Lp457TE1CnJ-DHnB6NB2LWxgA5K5K57Q6L7XcSHeYNpvARQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-13 20:01   ` Deucher, Alexander
       [not found]     ` <CY4PR12MB16533C83151D6FCFC11ED457F7250-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Deucher, Alexander @ 2017-03-13 20:01 UTC (permalink / raw)
  To: 'Daniel Drake',
	joro-zLv9SwRftAIdnm+yROfE0A, Suthikulpanit, Suravee, Nath,
	Arindam
  Cc: Linux Upstreaming Team,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Daniel Drake
> Sent: Monday, March 13, 2017 3:50 PM
> To: joro@8bytes.org
> Cc: Chris Chiu; iommu@lists.linux-foundation.org; Linux Upstreaming Team;
> amd-gfx@lists.freedesktop.org
> Subject: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
> loop timed out
> 
> Hi,
> 
> We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
> Acer Aspire E5-523 with standard configurations because during boot
> the screen is flooded with the following error message over and over:
> 
>   AMD-Vi: Completion-Wait loop timed out
> 
> We have left the system for quite a while but the message spam does
> not stop and the system doesn't complete the boot sequence.
> 
> We have reproduced on Linux 4.8 and Linux 4.10.
> 
> To avoid this, we can boot with iommu=soft or just disable the amdgpu
> display driver.
> 
> Looks like this may also affect HP 15-ba012no :
> https://bugzilla.redhat.com/show_bug.cgi?id=1409201
> 
> Earlier during boot the iommu is detected as:
> 
> [    1.274518] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
> [    1.274519] AMD-Vi: Extended features (0x37ef22294ada):
> [    1.274519]  PPR NX GT IA GA PC GA_vAPIC
> [    1.274523] AMD-Vi: Interrupt remapping enabled
> [    1.274523] AMD-Vi: virtual APIC enabled
> [    1.275144] AMD-Vi: Lazy IO/TLB flushing enabled
> [    1.276498] perf: AMD NB counters detected
> [    1.278096] LVT offset 0 assigned for vector 0x400
> [    1.278963] perf: AMD IBS detected (0x000007ff)
> [    1.278977] perf: amd_iommu: Detected. (0 banks, 0 counters/bank)
> 
> Any suggestions for how we can fix this, or get more useful debug info?

+Suravee and Arindam

We ran into similar issues and bisected it to commit b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the IOMMU hardware to know if this is an iommu or display driver issue yet.

Alex

> 
> Thanks
> Daniel
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]     ` <CY4PR12MB16533C83151D6FCFC11ED457F7250-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-03-14  6:16       ` Nath, Arindam
  2017-03-17 12:15       ` Daniel Drake
  1 sibling, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-03-14  6:16 UTC (permalink / raw)
  To: Deucher, Alexander, 'Daniel Drake',
	joro-zLv9SwRftAIdnm+yROfE0A, Suthikulpanit, Suravee
  Cc: Linux Upstreaming Team,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



>-----Original Message-----
>From: Deucher, Alexander
>Sent: Tuesday, March 14, 2017 1:31 AM
>To: 'Daniel Drake'; joro@8bytes.org; Suthikulpanit, Suravee; Nath, Arindam
>Cc: Chris Chiu; iommu@lists.linux-foundation.org; Linux Upstreaming Team;
>amd-gfx@lists.freedesktop.org
>Subject: RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
>loop timed out
>
>> -----Original Message-----
>> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
>> Of Daniel Drake
>> Sent: Monday, March 13, 2017 3:50 PM
>> To: joro@8bytes.org
>> Cc: Chris Chiu; iommu@lists.linux-foundation.org; Linux Upstreaming Team;
>> amd-gfx@lists.freedesktop.org
>> Subject: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
>> loop timed out
>>
>> Hi,
>>
>> We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
>> Acer Aspire E5-523 with standard configurations because during boot
>> the screen is flooded with the following error message over and over:
>>
>>   AMD-Vi: Completion-Wait loop timed out
>>
>> We have left the system for quite a while but the message spam does
>> not stop and the system doesn't complete the boot sequence.
>>
>> We have reproduced on Linux 4.8 and Linux 4.10.
>>
>> To avoid this, we can boot with iommu=soft or just disable the amdgpu
>> display driver.
>>
>> Looks like this may also affect HP 15-ba012no :
>> https://bugzilla.redhat.com/show_bug.cgi?id=1409201
>>
>> Earlier during boot the iommu is detected as:
>>
>> [    1.274518] AMD-Vi: Found IOMMU at 0000:00:00.2 cap 0x40
>> [    1.274519] AMD-Vi: Extended features (0x37ef22294ada):
>> [    1.274519]  PPR NX GT IA GA PC GA_vAPIC
>> [    1.274523] AMD-Vi: Interrupt remapping enabled
>> [    1.274523] AMD-Vi: virtual APIC enabled
>> [    1.275144] AMD-Vi: Lazy IO/TLB flushing enabled
>> [    1.276498] perf: AMD NB counters detected
>> [    1.278096] LVT offset 0 assigned for vector 0x400
>> [    1.278963] perf: AMD IBS detected (0x000007ff)
>> [    1.278977] perf: amd_iommu: Detected. (0 banks, 0 counters/bank)
>>
>> Any suggestions for how we can fix this, or get more useful debug info?
>
>+Suravee and Arindam
>
>We ran into similar issues and bisected it to commit
>b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the
>IOMMU hardware to know if this is an iommu or display driver issue yet.

Like Alex mentioned, we have not yet been able to root cause the issue. But another way to work-around the issue without disabling graphics driver or IOMMU is to use amd_iommu=fullflush kernel boot param.

Thanks,
Arindam

>
>Alex
>
>>
>> Thanks
>> Daniel
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]     ` <CY4PR12MB16533C83151D6FCFC11ED457F7250-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2017-03-14  6:16       ` Nath, Arindam
@ 2017-03-17 12:15       ` Daniel Drake
       [not found]         ` <CAD8Lp47zjJvqxY3TMMAhjz3OnLR52CtsQh_PQFPmsEW-xHfDwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: Daniel Drake @ 2017-03-17 12:15 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Nath,
	Arindam, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Linux Upstreaming Team

Hi,

On Mon, Mar 13, 2017 at 2:01 PM, Deucher, Alexander
<Alexander.Deucher-5C7GfCeVMHo@public.gmane.org> wrote:
> > We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
> > Acer Aspire E5-523 with standard configurations because during boot
> > the screen is flooded with the following error message over and over:
> >
> >   AMD-Vi: Completion-Wait loop timed out
>
> We ran into similar issues and bisected it to commit b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the IOMMU hardware to know if this is an iommu or display driver issue yet.

We can confirm that reverting this commit solves the issue.

Given that that commit is an optimization, but it has introduced a
regression on multiple platforms, and has been like this for 8 months,
it would be common practice to now revert this patch upstream until
the regression is fixed. Could you please send a new patch to do this?

Also, we would be happy to test any real solutions to this issue while
we still have the affected units in hand.

Thanks
Daniel

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]         ` <CAD8Lp47zjJvqxY3TMMAhjz3OnLR52CtsQh_PQFPmsEW-xHfDwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-17 15:53           ` Alex Deucher
       [not found]             ` <CADnq5_Oyfm-BzU9YV_QLjm6HxtMwnJcFkfYtjmCWpuah35TFvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Alex Deucher @ 2017-03-17 15:53 UTC (permalink / raw)
  To: Daniel Drake
  Cc: joro-zLv9SwRftAIdnm+yROfE0A, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Nath, Arindam,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Suthikulpanit,
	Suravee, Deucher, Alexander, Linux Upstreaming Team

On Fri, Mar 17, 2017 at 8:15 AM, Daniel Drake <drake@endlessm.com> wrote:
> Hi,
>
> On Mon, Mar 13, 2017 at 2:01 PM, Deucher, Alexander
> <Alexander.Deucher@amd.com> wrote:
>> > We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
>> > Acer Aspire E5-523 with standard configurations because during boot
>> > the screen is flooded with the following error message over and over:
>> >
>> >   AMD-Vi: Completion-Wait loop timed out
>>
>> We ran into similar issues and bisected it to commit b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the IOMMU hardware to know if this is an iommu or display driver issue yet.
>
> We can confirm that reverting this commit solves the issue.
>
> Given that that commit is an optimization, but it has introduced a
> regression on multiple platforms, and has been like this for 8 months,
> it would be common practice to now revert this patch upstream until
> the regression is fixed. Could you please send a new patch to do this?
>
> Also, we would be happy to test any real solutions to this issue while
> we still have the affected units in hand.

No objections to a revert here.

Alex


>
> Thanks
> Daniel
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]             ` <CADnq5_Oyfm-BzU9YV_QLjm6HxtMwnJcFkfYtjmCWpuah35TFvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-21 15:57               ` joro-zLv9SwRftAIdnm+yROfE0A
       [not found]                 ` <20170321155725.GD29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: joro-zLv9SwRftAIdnm+yROfE0A @ 2017-03-21 15:57 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Daniel Drake, Nath, Arindam,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

On Fri, Mar 17, 2017 at 11:53:09AM -0400, Alex Deucher wrote:
> On Fri, Mar 17, 2017 at 8:15 AM, Daniel Drake <drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org> wrote:
> > Hi,
> >
> > On Mon, Mar 13, 2017 at 2:01 PM, Deucher, Alexander
> > <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org> wrote:
> >> > We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON R7) nor
> >> > Acer Aspire E5-523 with standard configurations because during boot
> >> > the screen is flooded with the following error message over and over:
> >> >
> >> >   AMD-Vi: Completion-Wait loop timed out
> >>
> >> We ran into similar issues and bisected it to commit b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the IOMMU hardware to know if this is an iommu or display driver issue yet.
> >
> > We can confirm that reverting this commit solves the issue.
> >
> > Given that that commit is an optimization, but it has introduced a
> > regression on multiple platforms, and has been like this for 8 months,
> > it would be common practice to now revert this patch upstream until
> > the regression is fixed. Could you please send a new patch to do this?
> >
> > Also, we would be happy to test any real solutions to this issue while
> > we still have the affected units in hand.
> 
> No objections to a revert here.

Big objection here. Since this only happens with amdgpu so far we
shouldn't rule out a display-driver issue.

Reverting that patch basically destroys iommu-performance on AMD
systems. Doing this for all devices just to make amdgpu working is
overkill at this stage of the debugging.



	Joerg

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                 ` <20170321155725.GD29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-03-21 16:01                   ` Deucher, Alexander
       [not found]                     ` <BN6PR12MB16526DD4A3B60DB4E20B9907F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Deucher, Alexander @ 2017-03-21 16:01 UTC (permalink / raw)
  To: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org', Alex Deucher
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Daniel Drake, Nath, Arindam,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Suthikulpanit,
	Suravee, Linux Upstreaming Team

> -----Original Message-----
> From: joro@8bytes.org [mailto:joro@8bytes.org]
> Sent: Tuesday, March 21, 2017 11:57 AM
> To: Alex Deucher
> Cc: Daniel Drake; Deucher, Alexander; Chris Chiu; amd-
> gfx@lists.freedesktop.org; Nath, Arindam; iommu@lists.linux-
> foundation.org; Suthikulpanit, Suravee; Linux Upstreaming Team
> Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
> loop timed out
> 
> On Fri, Mar 17, 2017 at 11:53:09AM -0400, Alex Deucher wrote:
> > On Fri, Mar 17, 2017 at 8:15 AM, Daniel Drake <drake@endlessm.com>
> wrote:
> > > Hi,
> > >
> > > On Mon, Mar 13, 2017 at 2:01 PM, Deucher, Alexander
> > > <Alexander.Deucher@amd.com> wrote:
> > >> > We are unable to boot Acer Aspire E5-553G (AMD FX-9800P RADEON
> R7) nor
> > >> > Acer Aspire E5-523 with standard configurations because during boot
> > >> > the screen is flooded with the following error message over and over:
> > >> >
> > >> >   AMD-Vi: Completion-Wait loop timed out
> > >>
> > >> We ran into similar issues and bisected it to commit
> b1516a14657acf81a587e9a6e733a881625eee53.  I'm not too familiar with the
> IOMMU hardware to know if this is an iommu or display driver issue yet.
> > >
> > > We can confirm that reverting this commit solves the issue.
> > >
> > > Given that that commit is an optimization, but it has introduced a
> > > regression on multiple platforms, and has been like this for 8 months,
> > > it would be common practice to now revert this patch upstream until
> > > the regression is fixed. Could you please send a new patch to do this?
> > >
> > > Also, we would be happy to test any real solutions to this issue while
> > > we still have the affected units in hand.
> >
> > No objections to a revert here.
> 
> Big objection here. Since this only happens with amdgpu so far we
> shouldn't rule out a display-driver issue.
> 
> Reverting that patch basically destroys iommu-performance on AMD
> systems. Doing this for all devices just to make amdgpu working is
> overkill at this stage of the debugging.

It seems to only affect Stoney systems, but not others (Carrizo, Bristol, etc.).  Maybe we could just disable it on Stoney until we root cause it.

Alex

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                     ` <BN6PR12MB16526DD4A3B60DB4E20B9907F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-03-21 16:10                       ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
       [not found]                         ` <20170321161056.GE29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org' @ 2017-03-21 16:10 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Daniel Drake, Nath, Arindam,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Suthikulpanit,
	Suravee, Alex Deucher, Linux Upstreaming Team

On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
> It seems to only affect Stoney systems, but not others (Carrizo,
> Bristol, etc.).  Maybe we could just disable it on Stoney until we
> root cause it.

Completion-wait loop timeouts indicate something is seriously wrong. How
can I detect whether I am running on a 'Stoney' system?

Other question, a shot into the dark, does the GPU on these systems have
ATS? Probably yes, as they are likely HSA compatible.


	Joerg

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                         ` <20170321161056.GE29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-03-21 16:14                           ` Nath, Arindam
  2017-03-21 16:17                           ` Deucher, Alexander
  1 sibling, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-03-21 16:14 UTC (permalink / raw)
  To: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org',
	Deucher, Alexander
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Daniel Drake, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Alex Deucher, Linux Upstreaming Team

>-----Original Message-----
>From: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org' [mailto:joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org]
>Sent: Tuesday, March 21, 2017 9:41 PM
>To: Deucher, Alexander
>Cc: Alex Deucher; Daniel Drake; Chris Chiu; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org;
>Nath, Arindam; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit, Suravee;
>Linux Upstreaming Team
>Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
>loop timed out
>
>On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
>> It seems to only affect Stoney systems, but not others (Carrizo,
>> Bristol, etc.).  Maybe we could just disable it on Stoney until we
>> root cause it.
>
>Completion-wait loop timeouts indicate something is seriously wrong. How
>can I detect whether I am running on a 'Stoney' system?
>
>Other question, a shot into the dark, does the GPU on these systems have
>ATS? Probably yes, as they are likely HSA compatible.

The GPU on Stoney supports ATS.

Thanks,
Arindam

>
>
>	Joerg

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                         ` <20170321161056.GE29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-03-21 16:14                           ` Nath, Arindam
@ 2017-03-21 16:17                           ` Deucher, Alexander
       [not found]                             ` <BN6PR12MB16528AF8E5577E9ACB483212F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: Deucher, Alexander @ 2017-03-21 16:17 UTC (permalink / raw)
  To: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org', Bridgman, John
  Cc: Chris Chiu, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Daniel Drake, Nath, Arindam,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Alex Deucher,
	Linux Upstreaming Team

> -----Original Message-----
> From: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org' [mailto:joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org]
> Sent: Tuesday, March 21, 2017 12:11 PM
> To: Deucher, Alexander
> Cc: Alex Deucher; Daniel Drake; Chris Chiu; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org;
> Nath, Arindam; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit, Suravee;
> Linux Upstreaming Team
> Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
> loop timed out
> 
> On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
> > It seems to only affect Stoney systems, but not others (Carrizo,
> > Bristol, etc.).  Maybe we could just disable it on Stoney until we
> > root cause it.
> 
> Completion-wait loop timeouts indicate something is seriously wrong. How
> can I detect whether I am running on a 'Stoney' system?

+ John

I'm not sure if the iommu ids are different on stoney systems compared to Carrizo/Bristol systems.  The pci ids of the GPUs are different.  Stoney parts have 0x98E4 as the pci id for the GPU.

> 
> Other question, a shot into the dark, does the GPU on these systems have
> ATS? Probably yes, as they are likely HSA compatible.

Stoney is a small APU.  Kind of a mini Carrizo.  While it may claim to support ATS, I don't think it was ever validated on Stoney, only Carrizo/Bristol.

Alex

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                             ` <BN6PR12MB16528AF8E5577E9ACB483212F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-03-21 16:25                               ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
       [not found]                                 ` <20170321162532.GG29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org' @ 2017-03-21 16:25 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Bridgman, John, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Daniel Drake, Nath,
	Arindam, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Suthikulpanit, Suravee, Alex Deucher, Linux Upstreaming Team

On Tue, Mar 21, 2017 at 04:17:40PM +0000, Deucher, Alexander wrote:
> > -----Original Message-----
> > From: 'joro@8bytes.org' [mailto:joro@8bytes.org]
> > Sent: Tuesday, March 21, 2017 12:11 PM
> > To: Deucher, Alexander
> > Cc: Alex Deucher; Daniel Drake; Chris Chiu; amd-gfx@lists.freedesktop.org;
> > Nath, Arindam; iommu@lists.linux-foundation.org; Suthikulpanit, Suravee;
> > Linux Upstreaming Team
> > Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
> > loop timed out
> > 
> > On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
> > > It seems to only affect Stoney systems, but not others (Carrizo,
> > > Bristol, etc.).  Maybe we could just disable it on Stoney until we
> > > root cause it.
> > 
> > Completion-wait loop timeouts indicate something is seriously wrong. How
> > can I detect whether I am running on a 'Stoney' system?
> 
> + John
> 
> I'm not sure if the iommu ids are different on stoney systems compared to Carrizo/Bristol systems.  The pci ids of the GPUs are different.  Stoney parts have 0x98E4 as the pci id for the GPU.
> 
> > 
> > Other question, a shot into the dark, does the GPU on these systems have
> > ATS? Probably yes, as they are likely HSA compatible.
> 
> Stoney is a small APU.  Kind of a mini Carrizo.  While it may claim to support ATS, I don't think it was ever validated on Stoney, only Carrizo/Bristol.

Okay, so maybe ATS is broken in some way on these chips. When queue
flushes happen it will also send the ATS-invalidates, and a queue flush
can cause a storm of those. This may be the issue.

I am preparing a debug-patch that disables ATS for these GPUs so someone
with such a chip can test it.


	Joerg

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                 ` <20170321162532.GG29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-03-21 16:30                                   ` Deucher, Alexander
       [not found]                                     ` <BN6PR12MB165268CA4C460215950409D5F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2017-03-21 17:22                                   ` Tom St Denis
  1 sibling, 1 reply; 41+ messages in thread
From: Deucher, Alexander @ 2017-03-21 16:30 UTC (permalink / raw)
  To: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
  Cc: Bridgman, John, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Daniel Drake, Nath,
	Arindam, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Suthikulpanit, Suravee, Alex Deucher, Linux Upstreaming Team

> -----Original Message-----
> From: 'joro@8bytes.org' [mailto:joro@8bytes.org]
> Sent: Tuesday, March 21, 2017 12:26 PM
> To: Deucher, Alexander
> Cc: Bridgman, John; Alex Deucher; Daniel Drake; Chris Chiu; amd-
> gfx@lists.freedesktop.org; Nath, Arindam; iommu@lists.linux-
> foundation.org; Suthikulpanit, Suravee; Linux Upstreaming Team
> Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
> loop timed out
> 
> On Tue, Mar 21, 2017 at 04:17:40PM +0000, Deucher, Alexander wrote:
> > > -----Original Message-----
> > > From: 'joro@8bytes.org' [mailto:joro@8bytes.org]
> > > Sent: Tuesday, March 21, 2017 12:11 PM
> > > To: Deucher, Alexander
> > > Cc: Alex Deucher; Daniel Drake; Chris Chiu; amd-
> gfx@lists.freedesktop.org;
> > > Nath, Arindam; iommu@lists.linux-foundation.org; Suthikulpanit,
> Suravee;
> > > Linux Upstreaming Team
> > > Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-
> Wait
> > > loop timed out
> > >
> > > On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
> > > > It seems to only affect Stoney systems, but not others (Carrizo,
> > > > Bristol, etc.).  Maybe we could just disable it on Stoney until we
> > > > root cause it.
> > >
> > > Completion-wait loop timeouts indicate something is seriously wrong.
> How
> > > can I detect whether I am running on a 'Stoney' system?
> >
> > + John
> >
> > I'm not sure if the iommu ids are different on stoney systems compared to
> Carrizo/Bristol systems.  The pci ids of the GPUs are different.  Stoney parts
> have 0x98E4 as the pci id for the GPU.
> >
> > >
> > > Other question, a shot into the dark, does the GPU on these systems
> have
> > > ATS? Probably yes, as they are likely HSA compatible.
> >
> > Stoney is a small APU.  Kind of a mini Carrizo.  While it may claim to support
> ATS, I don't think it was ever validated on Stoney, only Carrizo/Bristol.
> 
> Okay, so maybe ATS is broken in some way on these chips. When queue
> flushes happen it will also send the ATS-invalidates, and a queue flush
> can cause a storm of those. This may be the issue.
> 
> I am preparing a debug-patch that disables ATS for these GPUs so someone
> with such a chip can test it.

Thanks Joerg.

Alex

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                 ` <20170321162532.GG29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-03-21 16:30                                   ` Deucher, Alexander
@ 2017-03-21 17:22                                   ` Tom St Denis
  1 sibling, 0 replies; 41+ messages in thread
From: Tom St Denis @ 2017-03-21 17:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 21/03/17 12:25 PM, 'joro@8bytes.org' wrote:
> On Tue, Mar 21, 2017 at 04:17:40PM +0000, Deucher, Alexander wrote:
>>> -----Original Message-----
>>> From: 'joro@8bytes.org' [mailto:joro@8bytes.org]
>>> Sent: Tuesday, March 21, 2017 12:11 PM
>>> To: Deucher, Alexander
>>> Cc: Alex Deucher; Daniel Drake; Chris Chiu; amd-gfx@lists.freedesktop.org;
>>> Nath, Arindam; iommu@lists.linux-foundation.org; Suthikulpanit, Suravee;
>>> Linux Upstreaming Team
>>> Subject: Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait
>>> loop timed out
>>>
>>> On Tue, Mar 21, 2017 at 04:01:53PM +0000, Deucher, Alexander wrote:
>>>> It seems to only affect Stoney systems, but not others (Carrizo,
>>>> Bristol, etc.).  Maybe we could just disable it on Stoney until we
>>>> root cause it.
>>>
>>> Completion-wait loop timeouts indicate something is seriously wrong. How
>>> can I detect whether I am running on a 'Stoney' system?
>>
>> + John
>>
>> I'm not sure if the iommu ids are different on stoney systems compared to Carrizo/Bristol systems.  The pci ids of the GPUs are different.  Stoney parts have 0x98E4 as the pci id for the GPU.
>>
>>>
>>> Other question, a shot into the dark, does the GPU on these systems have
>>> ATS? Probably yes, as they are likely HSA compatible.
>>
>> Stoney is a small APU.  Kind of a mini Carrizo.  While it may claim to support ATS, I don't think it was ever validated on Stoney, only Carrizo/Bristol.
>
> Okay, so maybe ATS is broken in some way on these chips. When queue
> flushes happen it will also send the ATS-invalidates, and a queue flush
> can cause a storm of those. This may be the issue.
>
> I am preparing a debug-patch that disables ATS for these GPUs so someone
> with such a chip can test it.
>


I have a stoney I can test said patch on.

Thanks,
Tom
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                     ` <BN6PR12MB165268CA4C460215950409D5F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-03-22 11:22                                       ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
       [not found]                                         ` <20170322112242.GK29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org' @ 2017-03-22 11:22 UTC (permalink / raw)
  To: Deucher, Alexander
  Cc: Bridgman, John, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Daniel Drake, Nath,
	Arindam, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Suthikulpanit, Suravee, Alex Deucher, Linux Upstreaming Team

On Tue, Mar 21, 2017 at 04:30:55PM +0000, Deucher, Alexander wrote:
> > I am preparing a debug-patch that disables ATS for these GPUs so someone
> > with such a chip can test it.
> 
> Thanks Joerg.

Here is a debug patch, using the hard hammer of disabling the use of ATS
completly in the AMD IOMMU driver. If it fixes the issue I am going to
write a more upstreamable version.

But for now, please test if this fixes the issue.

Thanks,

	Joerg

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 98940d1..f019aa6 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -467,7 +467,7 @@ static int iommu_init_device(struct device *dev)
 		struct amd_iommu *iommu;
 
 		iommu = amd_iommu_rlookup_table[dev_data->devid];
-		dev_data->iommu_v2 = iommu->is_iommu_v2;
+		dev_data->iommu_v2 = false;
 	}
 
 	dev->archdata.iommu = dev_data;
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 6130278..41d0e64 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -171,7 +171,7 @@ int amd_iommus_present;
 
 /* IOMMUs have a non-present cache? */
 bool amd_iommu_np_cache __read_mostly;
-bool amd_iommu_iotlb_sup __read_mostly = true;
+bool amd_iommu_iotlb_sup __read_mostly = false;
 
 u32 amd_iommu_max_pasid __read_mostly = ~0;
 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                         ` <20170322112242.GK29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-03-22 17:18                                           ` Tom St Denis
       [not found]                                             ` <afecf448-c9fe-c481-0d0e-6dec0f459eeb-5C7GfCeVMHo@public.gmane.org>
  2017-03-27  6:17                                           ` [PATCH] iommu/amd: flush IOTLB for specific domains only arindam.nath-5C7GfCeVMHo
  2017-03-27 12:23                                           ` amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out Daniel Drake
  2 siblings, 1 reply; 41+ messages in thread
From: Tom St Denis @ 2017-03-22 17:18 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 22/03/17 07:22 AM, 'joro@8bytes.org' wrote:
> On Tue, Mar 21, 2017 at 04:30:55PM +0000, Deucher, Alexander wrote:
>>> I am preparing a debug-patch that disables ATS for these GPUs so someone
>>> with such a chip can test it.
>>
>> Thanks Joerg.
>
> Here is a debug patch, using the hard hammer of disabling the use of ATS
> completly in the AMD IOMMU driver. If it fixes the issue I am going to
> write a more upstreamable version.
>
> But for now, please test if this fixes the issue.
>
> Thanks,
>
> 	Joerg
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 98940d1..f019aa6 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -467,7 +467,7 @@ static int iommu_init_device(struct device *dev)
>  		struct amd_iommu *iommu;
>
>  		iommu = amd_iommu_rlookup_table[dev_data->devid];
> -		dev_data->iommu_v2 = iommu->is_iommu_v2;
> +		dev_data->iommu_v2 = false;
>  	}
>
>  	dev->archdata.iommu = dev_data;
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 6130278..41d0e64 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -171,7 +171,7 @@ int amd_iommus_present;
>
>  /* IOMMUs have a non-present cache? */
>  bool amd_iommu_np_cache __read_mostly;
> -bool amd_iommu_iotlb_sup __read_mostly = true;
> +bool amd_iommu_iotlb_sup __read_mostly = false;
>
>  u32 amd_iommu_max_pasid __read_mostly = ~0;


I tried this out but still got a lockup during init.  I tried getting a 
dmesg log but it locked up before it outputted anything more (after the 
init).

Tom
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                             ` <afecf448-c9fe-c481-0d0e-6dec0f459eeb-5C7GfCeVMHo@public.gmane.org>
@ 2017-03-22 17:26                                               ` Tom St Denis
  0 siblings, 0 replies; 41+ messages in thread
From: Tom St Denis @ 2017-03-22 17:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 22/03/17 01:18 PM, Tom St Denis wrote:

> I tried this out but still got a lockup during init.  I tried getting a
> dmesg log but it locked up before it outputted anything more (after the
> init).

nvm.  Even with iommu disabled it fails to boot.  Stoney support dies 
occasionally on staging-4.9 so I'll have to bisect this first and then 
circle back to this iommu patch.

Tom
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                         ` <20170322112242.GK29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-03-22 17:18                                           ` Tom St Denis
@ 2017-03-27  6:17                                           ` arindam.nath-5C7GfCeVMHo
       [not found]                                             ` <1490595427-11979-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
  2017-03-27 12:23                                           ` amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out Daniel Drake
  2 siblings, 1 reply; 41+ messages in thread
From: arindam.nath-5C7GfCeVMHo @ 2017-03-27  6:17 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: John.Bridgman-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, Arindam Nath,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Suravee.Suthikulpanit-5C7GfCeVMHo, Alexander.Deucher-5C7GfCeVMHo,
	linux-6IF/jdPJHihWk0Htik3J/w

From: Arindam Nath <arindam.nath@amd.com>

The idea behind flush queues is to defer the IOTLB flushing
for domains for which the mappings are no longer valid. We
add such domains in queue_add(), and when the queue size
reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().

Since we have already taken lock before __queue_flush()
is called, we need to make sure the IOTLB flushing is
performed as quickly as possible.

In the current implementation, we perform IOTLB flushing
for all domains irrespective of which ones were actually
added in the flush queue initially. This can be quite
expensive especially for domains for which unmapping is
not required at this point of time.

This patch makes use of domain information in
'struct flush_queue_entry' to make sure we only flush
IOTLBs for domains who need it, skipping others.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
 drivers/iommu/amd_iommu.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 98940d1..6a9a048 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2227,15 +2227,16 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
 
 static void __queue_flush(struct flush_queue *queue)
 {
-	struct protection_domain *domain;
-	unsigned long flags;
 	int idx;
 
-	/* First flush TLB of all known domains */
-	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
-	list_for_each_entry(domain, &amd_iommu_pd_list, list)
-		domain_flush_tlb(domain);
-	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
+	/* First flush TLB of all domains which were added to flush queue */
+	for (idx = 0; idx < queue->next; ++idx) {
+		struct flush_queue_entry *entry;
+
+		entry = queue->entries + idx;
+
+		domain_flush_tlb(&entry->dma_dom->domain);
+	}
 
 	/* Wait until flushes have completed */
 	domain_flush_complete(NULL);
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out
       [not found]                                         ` <20170322112242.GK29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-03-22 17:18                                           ` Tom St Denis
  2017-03-27  6:17                                           ` [PATCH] iommu/amd: flush IOTLB for specific domains only arindam.nath-5C7GfCeVMHo
@ 2017-03-27 12:23                                           ` Daniel Drake
  2 siblings, 0 replies; 41+ messages in thread
From: Daniel Drake @ 2017-03-27 12:23 UTC (permalink / raw)
  To: joro-zLv9SwRftAIdnm+yROfE0A
  Cc: Bridgman, John, Chris Chiu,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Nath, Arindam,
	Alex Deucher, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Deucher, Alexander, Linux Upstreaming Team

Hi Joerg,

Thanks for looking into this. We confirm that this workaround avoids
the iommu log spam and that amdgpu appears to be working fine with it.

Daniel


On Wed, Mar 22, 2017 at 5:22 AM, joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> wrote:
> On Tue, Mar 21, 2017 at 04:30:55PM +0000, Deucher, Alexander wrote:
>> > I am preparing a debug-patch that disables ATS for these GPUs so someone
>> > with such a chip can test it.
>>
>> Thanks Joerg.
>
> Here is a debug patch, using the hard hammer of disabling the use of ATS
> completly in the AMD IOMMU driver. If it fixes the issue I am going to
> write a more upstreamable version.
>
> But for now, please test if this fixes the issue.
>
> Thanks,
>
>         Joerg
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 98940d1..f019aa6 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -467,7 +467,7 @@ static int iommu_init_device(struct device *dev)
>                 struct amd_iommu *iommu;
>
>                 iommu = amd_iommu_rlookup_table[dev_data->devid];
> -               dev_data->iommu_v2 = iommu->is_iommu_v2;
> +               dev_data->iommu_v2 = false;
>         }
>
>         dev->archdata.iommu = dev_data;
> diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
> index 6130278..41d0e64 100644
> --- a/drivers/iommu/amd_iommu_init.c
> +++ b/drivers/iommu/amd_iommu_init.c
> @@ -171,7 +171,7 @@ int amd_iommus_present;
>
>  /* IOMMUs have a non-present cache? */
>  bool amd_iommu_np_cache __read_mostly;
> -bool amd_iommu_iotlb_sup __read_mostly = true;
> +bool amd_iommu_iotlb_sup __read_mostly = false;
>
>  u32 amd_iommu_max_pasid __read_mostly = ~0;
>

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                             ` <1490595427-11979-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
@ 2017-03-27 12:25                                               ` Daniel Drake
       [not found]                                                 ` <CAD8Lp46RjsUJEvCR5qVY6p8za5H9iDGTAyJMDd1zO7gbgBvqfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-03-30  6:23                                                 ` Nath, Arindam
  2017-04-07 10:20                                               ` Joerg Roedel
  1 sibling, 2 replies; 41+ messages in thread
From: Daniel Drake @ 2017-03-27 12:25 UTC (permalink / raw)
  To: Nath, Arindam
  Cc: Bridgman, John, joro-zLv9SwRftAIdnm+yROfE0A,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Suthikulpanit,
	Suravee, Deucher, Alexander, Linux Upstreaming Team

Hi Arindam,

You CC'd me on this - does this mean that it is a fix for the issue
described in the thread "amd-iommu: can't boot with amdgpu, AMD-Vi:
Completion-Wait loop timed out" ?

Thanks
Daniel


On Mon, Mar 27, 2017 at 12:17 AM,  <arindam.nath@amd.com> wrote:
> From: Arindam Nath <arindam.nath@amd.com>
>
> The idea behind flush queues is to defer the IOTLB flushing
> for domains for which the mappings are no longer valid. We
> add such domains in queue_add(), and when the queue size
> reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>
> Since we have already taken lock before __queue_flush()
> is called, we need to make sure the IOTLB flushing is
> performed as quickly as possible.
>
> In the current implementation, we perform IOTLB flushing
> for all domains irrespective of which ones were actually
> added in the flush queue initially. This can be quite
> expensive especially for domains for which unmapping is
> not required at this point of time.
>
> This patch makes use of domain information in
> 'struct flush_queue_entry' to make sure we only flush
> IOTLBs for domains who need it, skipping others.
>
> Signed-off-by: Arindam Nath <arindam.nath@amd.com>
> ---
>  drivers/iommu/amd_iommu.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 98940d1..6a9a048 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,16 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
>
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -       struct protection_domain *domain;
> -       unsigned long flags;
>         int idx;
>
> -       /* First flush TLB of all known domains */
> -       spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -       list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -               domain_flush_tlb(domain);
> -       spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +       /* First flush TLB of all domains which were added to flush queue */
> +       for (idx = 0; idx < queue->next; ++idx) {
> +               struct flush_queue_entry *entry;
> +
> +               entry = queue->entries + idx;
> +
> +               domain_flush_tlb(&entry->dma_dom->domain);
> +       }
>
>         /* Wait until flushes have completed */
>         domain_flush_complete(NULL);
> --
> 1.9.1
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                 ` <CAD8Lp46RjsUJEvCR5qVY6p8za5H9iDGTAyJMDd1zO7gbgBvqfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-27 12:27                                                   ` Nath, Arindam
  0 siblings, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-03-27 12:27 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Bridgman, John, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

>-----Original Message-----
>From: Daniel Drake [mailto:drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org]
>Sent: Monday, March 27, 2017 5:56 PM
>To: Nath, Arindam
>Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
>gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
>Suravee; Linux Upstreaming Team
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
>
>Hi Arindam,
>
>You CC'd me on this - does this mean that it is a fix for the issue
>described in the thread "amd-iommu: can't boot with amdgpu, AMD-Vi:
>Completion-Wait loop timed out" ?

Yes Daniel, please test this patch to confirm if the issue gets resolved.

Thanks,
Arindam

>
>Thanks
>Daniel
>
>
>On Mon, Mar 27, 2017 at 12:17 AM,  <arindam.nath-5C7GfCeVMHo@public.gmane.org> wrote:
>> From: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>>
>> The idea behind flush queues is to defer the IOTLB flushing
>> for domains for which the mappings are no longer valid. We
>> add such domains in queue_add(), and when the queue size
>> reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>>
>> Since we have already taken lock before __queue_flush()
>> is called, we need to make sure the IOTLB flushing is
>> performed as quickly as possible.
>>
>> In the current implementation, we perform IOTLB flushing
>> for all domains irrespective of which ones were actually
>> added in the flush queue initially. This can be quite
>> expensive especially for domains for which unmapping is
>> not required at this point of time.
>>
>> This patch makes use of domain information in
>> 'struct flush_queue_entry' to make sure we only flush
>> IOTLBs for domains who need it, skipping others.
>>
>> Signed-off-by: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>> ---
>>  drivers/iommu/amd_iommu.c | 15 ++++++++-------
>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>> index 98940d1..6a9a048 100644
>> --- a/drivers/iommu/amd_iommu.c
>> +++ b/drivers/iommu/amd_iommu.c
>> @@ -2227,15 +2227,16 @@ static struct iommu_group
>*amd_iommu_device_group(struct device *dev)
>>
>>  static void __queue_flush(struct flush_queue *queue)
>>  {
>> -       struct protection_domain *domain;
>> -       unsigned long flags;
>>         int idx;
>>
>> -       /* First flush TLB of all known domains */
>> -       spin_lock_irqsave(&amd_iommu_pd_lock, flags);
>> -       list_for_each_entry(domain, &amd_iommu_pd_list, list)
>> -               domain_flush_tlb(domain);
>> -       spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
>> +       /* First flush TLB of all domains which were added to flush queue */
>> +       for (idx = 0; idx < queue->next; ++idx) {
>> +               struct flush_queue_entry *entry;
>> +
>> +               entry = queue->entries + idx;
>> +
>> +               domain_flush_tlb(&entry->dma_dom->domain);
>> +       }
>>
>>         /* Wait until flushes have completed */
>>         domain_flush_complete(NULL);
>> --
>> 1.9.1
>>

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only
  2017-03-27 12:25                                               ` Daniel Drake
       [not found]                                                 ` <CAD8Lp46RjsUJEvCR5qVY6p8za5H9iDGTAyJMDd1zO7gbgBvqfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-30  6:23                                                 ` Nath, Arindam
       [not found]                                                   ` <MWHPR12MB15186B0A864F247BFBEF8EAD9C340-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: Nath, Arindam @ 2017-03-30  6:23 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Bridgman, John, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

>-----Original Message-----
>From: Nath, Arindam
>Sent: Monday, March 27, 2017 5:57 PM
>To: 'Daniel Drake'
>Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
>gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
>Suravee; Linux Upstreaming Team
>Subject: RE: [PATCH] iommu/amd: flush IOTLB for specific domains only
>
>>-----Original Message-----
>>From: Daniel Drake [mailto:drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org]
>>Sent: Monday, March 27, 2017 5:56 PM
>>To: Nath, Arindam
>>Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
>>gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
>>Suravee; Linux Upstreaming Team
>>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
>>
>>Hi Arindam,
>>
>>You CC'd me on this - does this mean that it is a fix for the issue
>>described in the thread "amd-iommu: can't boot with amdgpu, AMD-Vi:
>>Completion-Wait loop timed out" ?
>
>Yes Daniel, please test this patch to confirm if the issue gets resolved.

Daniel, did you get chance to test this patch?

Thanks,
Arindam

>
>Thanks,
>Arindam
>
>>
>>Thanks
>>Daniel
>>
>>
>>On Mon, Mar 27, 2017 at 12:17 AM,  <arindam.nath-5C7GfCeVMHo@public.gmane.org> wrote:
>>> From: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>>>
>>> The idea behind flush queues is to defer the IOTLB flushing
>>> for domains for which the mappings are no longer valid. We
>>> add such domains in queue_add(), and when the queue size
>>> reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>>>
>>> Since we have already taken lock before __queue_flush()
>>> is called, we need to make sure the IOTLB flushing is
>>> performed as quickly as possible.
>>>
>>> In the current implementation, we perform IOTLB flushing
>>> for all domains irrespective of which ones were actually
>>> added in the flush queue initially. This can be quite
>>> expensive especially for domains for which unmapping is
>>> not required at this point of time.
>>>
>>> This patch makes use of domain information in
>>> 'struct flush_queue_entry' to make sure we only flush
>>> IOTLBs for domains who need it, skipping others.
>>>
>>> Signed-off-by: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>>> ---
>>>  drivers/iommu/amd_iommu.c | 15 ++++++++-------
>>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>>> index 98940d1..6a9a048 100644
>>> --- a/drivers/iommu/amd_iommu.c
>>> +++ b/drivers/iommu/amd_iommu.c
>>> @@ -2227,15 +2227,16 @@ static struct iommu_group
>>*amd_iommu_device_group(struct device *dev)
>>>
>>>  static void __queue_flush(struct flush_queue *queue)
>>>  {
>>> -       struct protection_domain *domain;
>>> -       unsigned long flags;
>>>         int idx;
>>>
>>> -       /* First flush TLB of all known domains */
>>> -       spin_lock_irqsave(&amd_iommu_pd_lock, flags);
>>> -       list_for_each_entry(domain, &amd_iommu_pd_list, list)
>>> -               domain_flush_tlb(domain);
>>> -       spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
>>> +       /* First flush TLB of all domains which were added to flush queue */
>>> +       for (idx = 0; idx < queue->next; ++idx) {
>>> +               struct flush_queue_entry *entry;
>>> +
>>> +               entry = queue->entries + idx;
>>> +
>>> +               domain_flush_tlb(&entry->dma_dom->domain);
>>> +       }
>>>
>>>         /* Wait until flushes have completed */
>>>         domain_flush_complete(NULL);
>>> --
>>> 1.9.1
>>>

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                   ` <MWHPR12MB15186B0A864F247BFBEF8EAD9C340-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-03-30 13:45                                                     ` Daniel Drake
       [not found]                                                       ` <CAD8Lp47VQ0X0ydsGMrpTu-y4LAXfg9N7+Mzb0hDWDsKc2P-kQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 41+ messages in thread
From: Daniel Drake @ 2017-03-30 13:45 UTC (permalink / raw)
  To: Nath, Arindam
  Cc: Bridgman, John, joro-zLv9SwRftAIdnm+yROfE0A,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Suthikulpanit,
	Suravee, Deucher, Alexander, Linux Upstreaming Team

On Thu, Mar 30, 2017 at 12:23 AM, Nath, Arindam <Arindam.Nath@amd.com> wrote:
> Daniel, did you get chance to test this patch?

Not yet. Should we test it alone or alongside "PCI: Blacklist AMD
Stoney GPU devices for ATS"?

Thanks
Daniel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                       ` <CAD8Lp47VQ0X0ydsGMrpTu-y4LAXfg9N7+Mzb0hDWDsKc2P-kQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-03-30 14:48                                                         ` Nath, Arindam
  2017-04-05 15:01                                                         ` Nath, Arindam
  1 sibling, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-03-30 14:48 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Bridgman, John, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

>-----Original Message-----
>From: Daniel Drake [mailto:drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org]
>Sent: Thursday, March 30, 2017 7:15 PM
>To: Nath, Arindam
>Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
>gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
>Suravee; Linux Upstreaming Team
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
>
>On Thu, Mar 30, 2017 at 12:23 AM, Nath, Arindam <Arindam.Nath-5C7GfCeVMHo@public.gmane.org>
>wrote:
>> Daniel, did you get chance to test this patch?
>
>Not yet. Should we test it alone or alongside "PCI: Blacklist AMD
>Stoney GPU devices for ATS"?

You should test this patch alone.

Thanks,
Arindam

>
>Thanks
>Daniel

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                       ` <CAD8Lp47VQ0X0ydsGMrpTu-y4LAXfg9N7+Mzb0hDWDsKc2P-kQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-03-30 14:48                                                         ` Nath, Arindam
@ 2017-04-05 15:01                                                         ` Nath, Arindam
       [not found]                                                           ` <MWHPR12MB15183AFF01D7D74109CC62FF9C0A0-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: Nath, Arindam @ 2017-04-05 15:01 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Bridgman, John, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

>-----Original Message-----
>From: Daniel Drake [mailto:drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org]
>Sent: Thursday, March 30, 2017 7:15 PM
>To: Nath, Arindam
>Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
>gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
>Suravee; Linux Upstreaming Team
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
>
>On Thu, Mar 30, 2017 at 12:23 AM, Nath, Arindam <Arindam.Nath-5C7GfCeVMHo@public.gmane.org>
>wrote:
>> Daniel, did you get chance to test this patch?
>
>Not yet. Should we test it alone or alongside "PCI: Blacklist AMD
>Stoney GPU devices for ATS"?

Daniel, any luck with this patch?

Thanks,
Arindam

>
>Thanks
>Daniel

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                             ` <1490595427-11979-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
  2017-03-27 12:25                                               ` Daniel Drake
@ 2017-04-07 10:20                                               ` Joerg Roedel
       [not found]                                                 ` <20170407102039.GW7266-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-05-22  7:48                                                   ` arindam.nath-5C7GfCeVMHo
  1 sibling, 2 replies; 41+ messages in thread
From: Joerg Roedel @ 2017-04-07 10:20 UTC (permalink / raw)
  To: arindam.nath-5C7GfCeVMHo
  Cc: John.Bridgman-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Alexander.Deucher-5C7GfCeVMHo, linux-6IF/jdPJHihWk0Htik3J/w

On Mon, Mar 27, 2017 at 11:47:07AM +0530, arindam.nath-5C7GfCeVMHo@public.gmane.org wrote:
> From: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
> 
> The idea behind flush queues is to defer the IOTLB flushing
> for domains for which the mappings are no longer valid. We
> add such domains in queue_add(), and when the queue size
> reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
> 
> Since we have already taken lock before __queue_flush()
> is called, we need to make sure the IOTLB flushing is
> performed as quickly as possible.
> 
> In the current implementation, we perform IOTLB flushing
> for all domains irrespective of which ones were actually
> added in the flush queue initially. This can be quite
> expensive especially for domains for which unmapping is
> not required at this point of time.
> 
> This patch makes use of domain information in
> 'struct flush_queue_entry' to make sure we only flush
> IOTLBs for domains who need it, skipping others.
> 
> Signed-off-by: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/iommu/amd_iommu.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 98940d1..6a9a048 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,16 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
>  
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -	struct protection_domain *domain;
> -	unsigned long flags;
>  	int idx;
>  
> -	/* First flush TLB of all known domains */
> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -		domain_flush_tlb(domain);
> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +	/* First flush TLB of all domains which were added to flush queue */
> +	for (idx = 0; idx < queue->next; ++idx) {
> +		struct flush_queue_entry *entry;
> +
> +		entry = queue->entries + idx;
> +
> +		domain_flush_tlb(&entry->dma_dom->domain);
> +	}

With this we will flush a domain every time we find one of its
iova-addresses in the flush queue, so potentially we flush a domain
multiple times per __queue_flush() call.

Its better to either add a flush-flag to the domains and evaluate that
in __queue_flush or keep a list of domains to flush to make the flushing
really more efficient.


	Joerg

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                           ` <MWHPR12MB15183AFF01D7D74109CC62FF9C0A0-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-05-08 18:22                                                             ` Daniel Drake
  0 siblings, 0 replies; 41+ messages in thread
From: Daniel Drake @ 2017-05-08 18:22 UTC (permalink / raw)
  To: Nath, Arindam
  Cc: Bridgman, John, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Deucher,
	Alexander, Linux Upstreaming Team

On Wed, Apr 5, 2017 at 9:01 AM, Nath, Arindam <Arindam.Nath-5C7GfCeVMHo@public.gmane.org> wrote:
>
> >-----Original Message-----
> >From: Daniel Drake [mailto:drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org]
> >Sent: Thursday, March 30, 2017 7:15 PM
> >To: Nath, Arindam
> >Cc: joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org; Deucher, Alexander; Bridgman, John; amd-
> >gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org; Suthikulpanit,
> >Suravee; Linux Upstreaming Team
> >Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
> >
> >On Thu, Mar 30, 2017 at 12:23 AM, Nath, Arindam <Arindam.Nath-5C7GfCeVMHo@public.gmane.org>
> >wrote:
> >> Daniel, did you get chance to test this patch?
> >
> >Not yet. Should we test it alone or alongside "PCI: Blacklist AMD
> >Stoney GPU devices for ATS"?
>
> Daniel, any luck with this patch?

Sorry for the delay. The patch appears to be working fine.

Daniel

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
       [not found]                                                 ` <20170407102039.GW7266-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-05-19  1:31                                                   ` Michel Dänzer
  2017-05-19 10:02                                                   ` [PATCH] iommu/amd: flush IOTLB for specific domains only (v2) arindam.nath-5C7GfCeVMHo
  1 sibling, 0 replies; 41+ messages in thread
From: Michel Dänzer @ 2017-05-19  1:31 UTC (permalink / raw)
  To: Joerg Roedel, arindam.nath-5C7GfCeVMHo
  Cc: John.Bridgman-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Suravee.Suthikulpanit-5C7GfCeVMHo, Alexander.Deucher-5C7GfCeVMHo,
	linux-6IF/jdPJHihWk0Htik3J/w

On 07/04/17 07:20 PM, Joerg Roedel wrote:
> On Mon, Mar 27, 2017 at 11:47:07AM +0530, arindam.nath@amd.com wrote:
>> From: Arindam Nath <arindam.nath@amd.com>
>>
>> The idea behind flush queues is to defer the IOTLB flushing
>> for domains for which the mappings are no longer valid. We
>> add such domains in queue_add(), and when the queue size
>> reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>>
>> Since we have already taken lock before __queue_flush()
>> is called, we need to make sure the IOTLB flushing is
>> performed as quickly as possible.
>>
>> In the current implementation, we perform IOTLB flushing
>> for all domains irrespective of which ones were actually
>> added in the flush queue initially. This can be quite
>> expensive especially for domains for which unmapping is
>> not required at this point of time.
>>
>> This patch makes use of domain information in
>> 'struct flush_queue_entry' to make sure we only flush
>> IOTLBs for domains who need it, skipping others.
>>
>> Signed-off-by: Arindam Nath <arindam.nath@amd.com>
>> ---
>>  drivers/iommu/amd_iommu.c | 15 ++++++++-------
>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>> index 98940d1..6a9a048 100644
>> --- a/drivers/iommu/amd_iommu.c
>> +++ b/drivers/iommu/amd_iommu.c
>> @@ -2227,15 +2227,16 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
>>  
>>  static void __queue_flush(struct flush_queue *queue)
>>  {
>> -	struct protection_domain *domain;
>> -	unsigned long flags;
>>  	int idx;
>>  
>> -	/* First flush TLB of all known domains */
>> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
>> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
>> -		domain_flush_tlb(domain);
>> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
>> +	/* First flush TLB of all domains which were added to flush queue */
>> +	for (idx = 0; idx < queue->next; ++idx) {
>> +		struct flush_queue_entry *entry;
>> +
>> +		entry = queue->entries + idx;
>> +
>> +		domain_flush_tlb(&entry->dma_dom->domain);
>> +	}
> 
> With this we will flush a domain every time we find one of its
> iova-addresses in the flush queue, so potentially we flush a domain
> multiple times per __queue_flush() call.
> 
> Its better to either add a flush-flag to the domains and evaluate that
> in __queue_flush or keep a list of domains to flush to make the flushing
> really more efficient.

Arindam, can you incorporate Joerg's feedback?

FWIW, looks like Carrizo systems are affected by this as well (see e.g.
https://bugs.freedesktop.org/show_bug.cgi?id=101029#c21), so it would be
good to land this fix in some form ASAP.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
       [not found]                                                 ` <20170407102039.GW7266-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  2017-05-19  1:31                                                   ` Michel Dänzer
@ 2017-05-19 10:02                                                   ` arindam.nath-5C7GfCeVMHo
       [not found]                                                     ` <1495188151-14358-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: arindam.nath-5C7GfCeVMHo @ 2017-05-19 10:02 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: John.Bridgman-5C7GfCeVMHo, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, Arindam Nath, Craig Stein,
	Suravee.Suthikulpanit-5C7GfCeVMHo, Alexander.Deucher-5C7GfCeVMHo,
	Felix.Kuehling-5C7GfCeVMHo, linux-6IF/jdPJHihWk0Htik3J/w,
	michel-otUistvHUpPR7s880joybQ

From: Arindam Nath <arindam.nath@amd.com>

Change History
--------------

v2: changes suggested by Joerg
- add flush flag to improve efficiency of flush operation

v1:
- The idea behind flush queues is to defer the IOTLB flushing
  for domains for which the mappings are no longer valid. We
  add such domains in queue_add(), and when the queue size
  reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().

  Since we have already taken lock before __queue_flush()
  is called, we need to make sure the IOTLB flushing is
  performed as quickly as possible.

  In the current implementation, we perform IOTLB flushing
  for all domains irrespective of which ones were actually
  added in the flush queue initially. This can be quite
  expensive especially for domains for which unmapping is
  not required at this point of time.

  This patch makes use of domain information in
  'struct flush_queue_entry' to make sure we only flush
  IOTLBs for domains who need it, skipping others.

Suggested-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
 drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
 drivers/iommu/amd_iommu_types.h |  2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 63cacf5..1edeebec 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
 
 static void __queue_flush(struct flush_queue *queue)
 {
-	struct protection_domain *domain;
-	unsigned long flags;
 	int idx;
 
-	/* First flush TLB of all known domains */
-	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
-	list_for_each_entry(domain, &amd_iommu_pd_list, list)
-		domain_flush_tlb(domain);
-	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
+	/* First flush TLB of all domains which were added to flush queue */
+	for (idx = 0; idx < queue->next; ++idx) {
+		struct flush_queue_entry *entry;
+
+		entry = queue->entries + idx;
+
+		/*
+		 * There might be cases where multiple IOVA entries for the
+		 * same domain are queued in the flush queue. To avoid
+		 * flushing the same domain again, we check whether the
+		 * flag is set or not. This improves the efficiency of
+		 * flush operation.
+		 */
+		if (!entry->dma_dom->domain.already_flushed) {
+			entry->dma_dom->domain.already_flushed = true;
+			domain_flush_tlb(&entry->dma_dom->domain);
+		}
+	}
 
 	/* Wait until flushes have completed */
 	domain_flush_complete(NULL);
@@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain *dma_dom,
 	pages     = __roundup_pow_of_two(pages);
 	address >>= PAGE_SHIFT;
 
+	dma_dom->domain.already_flushed = false;
+
 	queue = get_cpu_ptr(&flush_queue);
 	spin_lock_irqsave(&queue->lock, flags);
 
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 4de8f41..4f5519d 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -454,6 +454,8 @@ struct protection_domain {
 	bool updated;		/* complete domain flush required */
 	unsigned dev_cnt;	/* devices assigned to this domain */
 	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
+	bool already_flushed;	/* flag to avoid flushing the same domain again
+				   in a single invocation of __queue_flush() */
 };
 
 /*
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
       [not found]                                                     ` <1495188151-14358-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
@ 2017-05-19 13:35                                                       ` Jan Vesely
       [not found]                                                         ` <1495200930.4360.6.camel-kgbqMDwikbSVc3sceRu5cw@public.gmane.org>
  2017-05-22  1:08                                                       ` Michel Dänzer
  1 sibling, 1 reply; 41+ messages in thread
From: Jan Vesely @ 2017-05-19 13:35 UTC (permalink / raw)
  To: arindam.nath-5C7GfCeVMHo,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: John.Bridgman-5C7GfCeVMHo, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, michel-otUistvHUpPR7s880joybQ,
	Craig Stein, Suravee.Suthikulpanit-5C7GfCeVMHo,
	Alexander.Deucher-5C7GfCeVMHo, linux-6IF/jdPJHihWk0Htik3J/w,
	Felix.Kuehling-5C7GfCeVMHo


[-- Attachment #1.1: Type: text/plain, Size: 4317 bytes --]

On Fri, 2017-05-19 at 15:32 +0530, arindam.nath-5C7GfCeVMHo@public.gmane.org wrote:
> From: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
> 
> Change History
> --------------
> 
> v2: changes suggested by Joerg
> - add flush flag to improve efficiency of flush operation
> 
> v1:
> - The idea behind flush queues is to defer the IOTLB flushing
>   for domains for which the mappings are no longer valid. We
>   add such domains in queue_add(), and when the queue size
>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
> 
>   Since we have already taken lock before __queue_flush()
>   is called, we need to make sure the IOTLB flushing is
>   performed as quickly as possible.
> 
>   In the current implementation, we perform IOTLB flushing
>   for all domains irrespective of which ones were actually
>   added in the flush queue initially. This can be quite
>   expensive especially for domains for which unmapping is
>   not required at this point of time.
> 
>   This patch makes use of domain information in
>   'struct flush_queue_entry' to make sure we only flush
>   IOTLBs for domains who need it, skipping others.

Hi,

just a note, the patch also fixes "AMD-Vi: Completion-Wait loop timed
out" boot hang on my system (carrizo + iceland) [0,1,2]. Presumably the
old loop also tried to flush domains that included powered-off devices.

regards,
Jan

[0] https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/issues/20
[1] https://bugs.freedesktop.org/show_bug.cgi?id=101029
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1448121

> 
> Suggested-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
>  drivers/iommu/amd_iommu_types.h |  2 ++
>  2 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 63cacf5..1edeebec 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
>  
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -	struct protection_domain *domain;
> -	unsigned long flags;
>  	int idx;
>  
> -	/* First flush TLB of all known domains */
> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -		domain_flush_tlb(domain);
> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +	/* First flush TLB of all domains which were added to flush queue */
> +	for (idx = 0; idx < queue->next; ++idx) {
> +		struct flush_queue_entry *entry;
> +
> +		entry = queue->entries + idx;
> +
> +		/*
> +		 * There might be cases where multiple IOVA entries for the
> +		 * same domain are queued in the flush queue. To avoid
> +		 * flushing the same domain again, we check whether the
> +		 * flag is set or not. This improves the efficiency of
> +		 * flush operation.
> +		 */
> +		if (!entry->dma_dom->domain.already_flushed) {
> +			entry->dma_dom->domain.already_flushed = true;
> +			domain_flush_tlb(&entry->dma_dom->domain);
> +		}
> +	}
>  
>  	/* Wait until flushes have completed */
>  	domain_flush_complete(NULL);
> @@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain *dma_dom,
>  	pages     = __roundup_pow_of_two(pages);
>  	address >>= PAGE_SHIFT;
>  
> +	dma_dom->domain.already_flushed = false;
> +
>  	queue = get_cpu_ptr(&flush_queue);
>  	spin_lock_irqsave(&queue->lock, flags);
>  
> diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
> index 4de8f41..4f5519d 100644
> --- a/drivers/iommu/amd_iommu_types.h
> +++ b/drivers/iommu/amd_iommu_types.h
> @@ -454,6 +454,8 @@ struct protection_domain {
>  	bool updated;		/* complete domain flush required */
>  	unsigned dev_cnt;	/* devices assigned to this domain */
>  	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
> +	bool already_flushed;	/* flag to avoid flushing the same domain again
> +				   in a single invocation of __queue_flush() */
>  };
>  
>  /*

-- 
Jan Vesely <jan.vesely-kgbqMDwikbSVc3sceRu5cw@public.gmane.org>

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
       [not found]                                                         ` <1495200930.4360.6.camel-kgbqMDwikbSVc3sceRu5cw@public.gmane.org>
@ 2017-05-21  7:25                                                           ` Nath, Arindam
  0 siblings, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-05-21  7:25 UTC (permalink / raw)
  To: Joerg Roedel, Jan Vesely,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Bridgman, John, Kuehling, Felix,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, Craig Stein, Deucher, Alexander,
	linux-6IF/jdPJHihWk0Htik3J/w, michel-otUistvHUpPR7s880joybQ

>-----Original Message-----
>From: Jan Vesely [mailto:jv356-nChP9VK/LToysehGhLVACCmkPJUwDNjP@public.gmane.org] On Behalf Of Jan
>Vesely
>Sent: Friday, May 19, 2017 7:06 PM
>To: Nath, Arindam; iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
>Cc: Bridgman, John; Joerg Roedel; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org;
>drake-6IF/jdPJHihWk0Htik3J/w@public.gmane.org; Craig Stein; Suthikulpanit, Suravee; Deucher,
>Alexander; Kuehling, Felix; linux-6IF/jdPJHihWk0Htik3J/w@public.gmane.org; michel-otUistvHUpPR7s880joybQ@public.gmane.org
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
>
>On Fri, 2017-05-19 at 15:32 +0530, arindam.nath-5C7GfCeVMHo@public.gmane.org wrote:
>> From: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>>
>> Change History
>> --------------
>>
>> v2: changes suggested by Joerg
>> - add flush flag to improve efficiency of flush operation

Joerg, do you have any comments on the patch?

Thanks,
Arindam

>>
>> v1:
>> - The idea behind flush queues is to defer the IOTLB flushing
>>   for domains for which the mappings are no longer valid. We
>>   add such domains in queue_add(), and when the queue size
>>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>>
>>   Since we have already taken lock before __queue_flush()
>>   is called, we need to make sure the IOTLB flushing is
>>   performed as quickly as possible.
>>
>>   In the current implementation, we perform IOTLB flushing
>>   for all domains irrespective of which ones were actually
>>   added in the flush queue initially. This can be quite
>>   expensive especially for domains for which unmapping is
>>   not required at this point of time.
>>
>>   This patch makes use of domain information in
>>   'struct flush_queue_entry' to make sure we only flush
>>   IOTLBs for domains who need it, skipping others.
>
>Hi,
>
>just a note, the patch also fixes "AMD-Vi: Completion-Wait loop timed
>out" boot hang on my system (carrizo + iceland) [0,1,2]. Presumably the
>old loop also tried to flush domains that included powered-off devices.
>
>regards,
>Jan
>
>[0] https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/issues/20
>[1] https://bugs.freedesktop.org/show_bug.cgi?id=101029
>[2] https://bugzilla.redhat.com/show_bug.cgi?id=1448121
>
>>
>> Suggested-by: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
>> Signed-off-by: Arindam Nath <arindam.nath-5C7GfCeVMHo@public.gmane.org>
>> ---
>>  drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
>>  drivers/iommu/amd_iommu_types.h |  2 ++
>>  2 files changed, 22 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>> index 63cacf5..1edeebec 100644
>> --- a/drivers/iommu/amd_iommu.c
>> +++ b/drivers/iommu/amd_iommu.c
>> @@ -2227,15 +2227,26 @@ static struct iommu_group
>*amd_iommu_device_group(struct device *dev)
>>
>>  static void __queue_flush(struct flush_queue *queue)
>>  {
>> -	struct protection_domain *domain;
>> -	unsigned long flags;
>>  	int idx;
>>
>> -	/* First flush TLB of all known domains */
>> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
>> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
>> -		domain_flush_tlb(domain);
>> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
>> +	/* First flush TLB of all domains which were added to flush queue */
>> +	for (idx = 0; idx < queue->next; ++idx) {
>> +		struct flush_queue_entry *entry;
>> +
>> +		entry = queue->entries + idx;
>> +
>> +		/*
>> +		 * There might be cases where multiple IOVA entries for the
>> +		 * same domain are queued in the flush queue. To avoid
>> +		 * flushing the same domain again, we check whether the
>> +		 * flag is set or not. This improves the efficiency of
>> +		 * flush operation.
>> +		 */
>> +		if (!entry->dma_dom->domain.already_flushed) {
>> +			entry->dma_dom->domain.already_flushed = true;
>> +			domain_flush_tlb(&entry->dma_dom->domain);
>> +		}
>> +	}
>>
>>  	/* Wait until flushes have completed */
>>  	domain_flush_complete(NULL);
>> @@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain
>*dma_dom,
>>  	pages     = __roundup_pow_of_two(pages);
>>  	address >>= PAGE_SHIFT;
>>
>> +	dma_dom->domain.already_flushed = false;
>> +
>>  	queue = get_cpu_ptr(&flush_queue);
>>  	spin_lock_irqsave(&queue->lock, flags);
>>
>> diff --git a/drivers/iommu/amd_iommu_types.h
>b/drivers/iommu/amd_iommu_types.h
>> index 4de8f41..4f5519d 100644
>> --- a/drivers/iommu/amd_iommu_types.h
>> +++ b/drivers/iommu/amd_iommu_types.h
>> @@ -454,6 +454,8 @@ struct protection_domain {
>>  	bool updated;		/* complete domain flush required */
>>  	unsigned dev_cnt;	/* devices assigned to this domain */
>>  	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference
>count */
>> +	bool already_flushed;	/* flag to avoid flushing the same domain
>again
>> +				   in a single invocation of __queue_flush() */
>>  };
>>
>>  /*
>
>--
>Jan Vesely <jan.vesely-kgbqMDwikbSVc3sceRu5cw@public.gmane.org>

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
       [not found]                                                     ` <1495188151-14358-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
  2017-05-19 13:35                                                       ` Jan Vesely
@ 2017-05-22  1:08                                                       ` Michel Dänzer
       [not found]                                                         ` <c03c7d65-52a7-b656-2278-0cfb24e8d07a-otUistvHUpPR7s880joybQ@public.gmane.org>
  1 sibling, 1 reply; 41+ messages in thread
From: Michel Dänzer @ 2017-05-22  1:08 UTC (permalink / raw)
  To: arindam.nath-5C7GfCeVMHo
  Cc: John.Bridgman-5C7GfCeVMHo, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Craig Stein,
	Suravee.Suthikulpanit-5C7GfCeVMHo, Alexander.Deucher-5C7GfCeVMHo,
	linux-6IF/jdPJHihWk0Htik3J/w, Felix.Kuehling-5C7GfCeVMHo

On 19/05/17 07:02 PM, arindam.nath@amd.com wrote:
> From: Arindam Nath <arindam.nath@amd.com>
> 
> Change History
> --------------
> 
> v2: changes suggested by Joerg
> - add flush flag to improve efficiency of flush operation
> 
> v1:
> - The idea behind flush queues is to defer the IOTLB flushing
>   for domains for which the mappings are no longer valid. We
>   add such domains in queue_add(), and when the queue size
>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
> 
>   Since we have already taken lock before __queue_flush()
>   is called, we need to make sure the IOTLB flushing is
>   performed as quickly as possible.
> 
>   In the current implementation, we perform IOTLB flushing
>   for all domains irrespective of which ones were actually
>   added in the flush queue initially. This can be quite
>   expensive especially for domains for which unmapping is
>   not required at this point of time.
> 
>   This patch makes use of domain information in
>   'struct flush_queue_entry' to make sure we only flush
>   IOTLBs for domains who need it, skipping others.
> 
> Suggested-by: Joerg Roedel <joro@8bytes.org>
> Signed-off-by: Arindam Nath <arindam.nath@amd.com>

Please add these tags:

Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
Cc: stable@vger.kernel.org


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v2)
       [not found]                                                         ` <c03c7d65-52a7-b656-2278-0cfb24e8d07a-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-05-22  1:12                                                           ` Michel Dänzer
  0 siblings, 0 replies; 41+ messages in thread
From: Michel Dänzer @ 2017-05-22  1:12 UTC (permalink / raw)
  To: arindam.nath-5C7GfCeVMHo
  Cc: John.Bridgman-5C7GfCeVMHo,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Craig Stein,
	Alexander.Deucher-5C7GfCeVMHo, linux-6IF/jdPJHihWk0Htik3J/w,
	Felix.Kuehling-5C7GfCeVMHo

On 22/05/17 10:08 AM, Michel Dänzer wrote:
> On 19/05/17 07:02 PM, arindam.nath@amd.com wrote:
>> From: Arindam Nath <arindam.nath@amd.com>
>>
>> Change History
>> --------------
>>
>> v2: changes suggested by Joerg
>> - add flush flag to improve efficiency of flush operation
>>
>> v1:
>> - The idea behind flush queues is to defer the IOTLB flushing
>>   for domains for which the mappings are no longer valid. We
>>   add such domains in queue_add(), and when the queue size
>>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
>>
>>   Since we have already taken lock before __queue_flush()
>>   is called, we need to make sure the IOTLB flushing is
>>   performed as quickly as possible.
>>
>>   In the current implementation, we perform IOTLB flushing
>>   for all domains irrespective of which ones were actually
>>   added in the flush queue initially. This can be quite
>>   expensive especially for domains for which unmapping is
>>   not required at this point of time.
>>
>>   This patch makes use of domain information in
>>   'struct flush_queue_entry' to make sure we only flush
>>   IOTLBs for domains who need it, skipping others.
>>
>> Suggested-by: Joerg Roedel <joro@8bytes.org>
>> Signed-off-by: Arindam Nath <arindam.nath@amd.com>
> 
> Please add these tags:
> 
> Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
> Cc: stable@vger.kernel.org

Also

Bugzilla: https://bugs.freedesktop.org/101029


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
       [not found]                                                 ` <20170407102039.GW7266-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2017-05-22  7:48                                                   ` arindam.nath-5C7GfCeVMHo
  2017-05-19 10:02                                                   ` [PATCH] iommu/amd: flush IOTLB for specific domains only (v2) arindam.nath-5C7GfCeVMHo
  1 sibling, 0 replies; 41+ messages in thread
From: arindam.nath @ 2017-05-22  7:48 UTC (permalink / raw)
  To: iommu
  Cc: amd-gfx, Joerg Roedel, Alexander.Deucher, John.Bridgman, drake,
	Suravee.Suthikulpanit, linux, Craig Stein, michel,
	Felix.Kuehling, stable, Arindam Nath

From: Arindam Nath <arindam.nath@amd.com>

Change History
--------------

v3:
- add Fixes and CC tags
- add link to Bugzilla

v2: changes suggested by Joerg
- add flush flag to improve efficiency of flush operation

v1:
- The idea behind flush queues is to defer the IOTLB flushing
  for domains for which the mappings are no longer valid. We
  add such domains in queue_add(), and when the queue size
  reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().

  Since we have already taken lock before __queue_flush()
  is called, we need to make sure the IOTLB flushing is
  performed as quickly as possible.

  In the current implementation, we perform IOTLB flushing
  for all domains irrespective of which ones were actually
  added in the flush queue initially. This can be quite
  expensive especially for domains for which unmapping is
  not required at this point of time.

  This patch makes use of domain information in
  'struct flush_queue_entry' to make sure we only flush
  IOTLBs for domains who need it, skipping others.

Bugzilla: https://bugs.freedesktop.org/101029
Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
Cc: stable@vger.kernel.org
Suggested-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
 drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
 drivers/iommu/amd_iommu_types.h |  2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 63cacf5..1edeebec 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
 
 static void __queue_flush(struct flush_queue *queue)
 {
-	struct protection_domain *domain;
-	unsigned long flags;
 	int idx;
 
-	/* First flush TLB of all known domains */
-	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
-	list_for_each_entry(domain, &amd_iommu_pd_list, list)
-		domain_flush_tlb(domain);
-	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
+	/* First flush TLB of all domains which were added to flush queue */
+	for (idx = 0; idx < queue->next; ++idx) {
+		struct flush_queue_entry *entry;
+
+		entry = queue->entries + idx;
+
+		/*
+		 * There might be cases where multiple IOVA entries for the
+		 * same domain are queued in the flush queue. To avoid
+		 * flushing the same domain again, we check whether the
+		 * flag is set or not. This improves the efficiency of
+		 * flush operation.
+		 */
+		if (!entry->dma_dom->domain.already_flushed) {
+			entry->dma_dom->domain.already_flushed = true;
+			domain_flush_tlb(&entry->dma_dom->domain);
+		}
+	}
 
 	/* Wait until flushes have completed */
 	domain_flush_complete(NULL);
@@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain *dma_dom,
 	pages     = __roundup_pow_of_two(pages);
 	address >>= PAGE_SHIFT;
 
+	dma_dom->domain.already_flushed = false;
+
 	queue = get_cpu_ptr(&flush_queue);
 	spin_lock_irqsave(&queue->lock, flags);
 
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 4de8f41..4f5519d 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -454,6 +454,8 @@ struct protection_domain {
 	bool updated;		/* complete domain flush required */
 	unsigned dev_cnt;	/* devices assigned to this domain */
 	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
+	bool already_flushed;	/* flag to avoid flushing the same domain again
+				   in a single invocation of __queue_flush() */
 };
 
 /*
-- 
2.7.4

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

* [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
@ 2017-05-22  7:48                                                   ` arindam.nath-5C7GfCeVMHo
  0 siblings, 0 replies; 41+ messages in thread
From: arindam.nath-5C7GfCeVMHo @ 2017-05-22  7:48 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: John.Bridgman-5C7GfCeVMHo, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, Arindam Nath, Craig Stein,
	stable-u79uwXL29TY76Z2rM5mHXA, Suravee.Suthikulpanit-5C7GfCeVMHo,
	Alexander.Deucher-5C7GfCeVMHo, Felix.Kuehling-5C7GfCeVMHo,
	linux-6IF/jdPJHihWk0Htik3J/w, michel-otUistvHUpPR7s880joybQ

From: Arindam Nath <arindam.nath@amd.com>

Change History
--------------

v3:
- add Fixes and CC tags
- add link to Bugzilla

v2: changes suggested by Joerg
- add flush flag to improve efficiency of flush operation

v1:
- The idea behind flush queues is to defer the IOTLB flushing
  for domains for which the mappings are no longer valid. We
  add such domains in queue_add(), and when the queue size
  reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().

  Since we have already taken lock before __queue_flush()
  is called, we need to make sure the IOTLB flushing is
  performed as quickly as possible.

  In the current implementation, we perform IOTLB flushing
  for all domains irrespective of which ones were actually
  added in the flush queue initially. This can be quite
  expensive especially for domains for which unmapping is
  not required at this point of time.

  This patch makes use of domain information in
  'struct flush_queue_entry' to make sure we only flush
  IOTLBs for domains who need it, skipping others.

Bugzilla: https://bugs.freedesktop.org/101029
Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
Cc: stable@vger.kernel.org
Suggested-by: Joerg Roedel <joro@8bytes.org>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
---
 drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
 drivers/iommu/amd_iommu_types.h |  2 ++
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 63cacf5..1edeebec 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
 
 static void __queue_flush(struct flush_queue *queue)
 {
-	struct protection_domain *domain;
-	unsigned long flags;
 	int idx;
 
-	/* First flush TLB of all known domains */
-	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
-	list_for_each_entry(domain, &amd_iommu_pd_list, list)
-		domain_flush_tlb(domain);
-	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
+	/* First flush TLB of all domains which were added to flush queue */
+	for (idx = 0; idx < queue->next; ++idx) {
+		struct flush_queue_entry *entry;
+
+		entry = queue->entries + idx;
+
+		/*
+		 * There might be cases where multiple IOVA entries for the
+		 * same domain are queued in the flush queue. To avoid
+		 * flushing the same domain again, we check whether the
+		 * flag is set or not. This improves the efficiency of
+		 * flush operation.
+		 */
+		if (!entry->dma_dom->domain.already_flushed) {
+			entry->dma_dom->domain.already_flushed = true;
+			domain_flush_tlb(&entry->dma_dom->domain);
+		}
+	}
 
 	/* Wait until flushes have completed */
 	domain_flush_complete(NULL);
@@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain *dma_dom,
 	pages     = __roundup_pow_of_two(pages);
 	address >>= PAGE_SHIFT;
 
+	dma_dom->domain.already_flushed = false;
+
 	queue = get_cpu_ptr(&flush_queue);
 	spin_lock_irqsave(&queue->lock, flags);
 
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 4de8f41..4f5519d 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -454,6 +454,8 @@ struct protection_domain {
 	bool updated;		/* complete domain flush required */
 	unsigned dev_cnt;	/* devices assigned to this domain */
 	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference count */
+	bool already_flushed;	/* flag to avoid flushing the same domain again
+				   in a single invocation of __queue_flush() */
 };
 
 /*
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
@ 2017-05-23 18:24                                                     ` Deucher, Alexander
  0 siblings, 0 replies; 41+ messages in thread
From: Deucher, Alexander @ 2017-05-23 18:24 UTC (permalink / raw)
  To: Nath, Arindam, iommu
  Cc: amd-gfx, Joerg Roedel, Bridgman, John, drake, Suthikulpanit,
	Suravee, linux, Craig Stein, michel, Kuehling, Felix, stable,
	Nath, Arindam

> -----Original Message-----
> From: Arindam Nath [mailto:anath.amd@gmail.com] On Behalf Of
> arindam.nath@amd.com
> Sent: Monday, May 22, 2017 3:48 AM
> To: iommu@lists.linux-foundation.org
> Cc: amd-gfx@lists.freedesktop.org; Joerg Roedel; Deucher, Alexander;
> Bridgman, John; drake@endlessm.com; Suthikulpanit, Suravee;
> linux@endlessm.com; Craig Stein; michel@daenzer.net; Kuehling, Felix;
> stable@vger.kernel.org; Nath, Arindam
> Subject: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
> 
> From: Arindam Nath <arindam.nath@amd.com>
> 
> Change History
> --------------
> 
> v3:
> - add Fixes and CC tags
> - add link to Bugzilla
> 
> v2: changes suggested by Joerg
> - add flush flag to improve efficiency of flush operation
> 
> v1:
> - The idea behind flush queues is to defer the IOTLB flushing
>   for domains for which the mappings are no longer valid. We
>   add such domains in queue_add(), and when the queue size
>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
> 
>   Since we have already taken lock before __queue_flush()
>   is called, we need to make sure the IOTLB flushing is
>   performed as quickly as possible.
> 
>   In the current implementation, we perform IOTLB flushing
>   for all domains irrespective of which ones were actually
>   added in the flush queue initially. This can be quite
>   expensive especially for domains for which unmapping is
>   not required at this point of time.
> 
>   This patch makes use of domain information in
>   'struct flush_queue_entry' to make sure we only flush
>   IOTLBs for domains who need it, skipping others.
> 
> Bugzilla: https://bugs.freedesktop.org/101029
> Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
> Cc: stable@vger.kernel.org
> Suggested-by: Joerg Roedel <joro@8bytes.org>
> Signed-off-by: Arindam Nath <arindam.nath@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
>  drivers/iommu/amd_iommu_types.h |  2 ++
>  2 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 63cacf5..1edeebec 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,26 @@ static struct iommu_group
> *amd_iommu_device_group(struct device *dev)
> 
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -	struct protection_domain *domain;
> -	unsigned long flags;
>  	int idx;
> 
> -	/* First flush TLB of all known domains */
> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -		domain_flush_tlb(domain);
> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +	/* First flush TLB of all domains which were added to flush queue */
> +	for (idx = 0; idx < queue->next; ++idx) {
> +		struct flush_queue_entry *entry;
> +
> +		entry = queue->entries + idx;
> +
> +		/*
> +		 * There might be cases where multiple IOVA entries for the
> +		 * same domain are queued in the flush queue. To avoid
> +		 * flushing the same domain again, we check whether the
> +		 * flag is set or not. This improves the efficiency of
> +		 * flush operation.
> +		 */
> +		if (!entry->dma_dom->domain.already_flushed) {
> +			entry->dma_dom->domain.already_flushed = true;
> +			domain_flush_tlb(&entry->dma_dom->domain);
> +		}
> +	}
> 
>  	/* Wait until flushes have completed */
>  	domain_flush_complete(NULL);
> @@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain
> *dma_dom,
>  	pages     = __roundup_pow_of_two(pages);
>  	address >>= PAGE_SHIFT;
> 
> +	dma_dom->domain.already_flushed = false;
> +
>  	queue = get_cpu_ptr(&flush_queue);
>  	spin_lock_irqsave(&queue->lock, flags);
> 
> diff --git a/drivers/iommu/amd_iommu_types.h
> b/drivers/iommu/amd_iommu_types.h
> index 4de8f41..4f5519d 100644
> --- a/drivers/iommu/amd_iommu_types.h
> +++ b/drivers/iommu/amd_iommu_types.h
> @@ -454,6 +454,8 @@ struct protection_domain {
>  	bool updated;		/* complete domain flush required */
>  	unsigned dev_cnt;	/* devices assigned to this domain */
>  	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference
> count */
> +	bool already_flushed;	/* flag to avoid flushing the same domain
> again
> +				   in a single invocation of __queue_flush() */
>  };
> 
>  /*
> --
> 2.7.4

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
@ 2017-05-23 18:24                                                     ` Deucher, Alexander
  0 siblings, 0 replies; 41+ messages in thread
From: Deucher, Alexander @ 2017-05-23 18:24 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: Bridgman, John, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	drake-6IF/jdPJHihWk0Htik3J/w, Nath, Arindam, Craig Stein,
	stable-u79uwXL29TY76Z2rM5mHXA, Suthikulpanit, Suravee, Kuehling,
	Felix, linux-6IF/jdPJHihWk0Htik3J/w,
	michel-otUistvHUpPR7s880joybQ

> -----Original Message-----
> From: Arindam Nath [mailto:anath.amd@gmail.com] On Behalf Of
> arindam.nath@amd.com
> Sent: Monday, May 22, 2017 3:48 AM
> To: iommu@lists.linux-foundation.org
> Cc: amd-gfx@lists.freedesktop.org; Joerg Roedel; Deucher, Alexander;
> Bridgman, John; drake@endlessm.com; Suthikulpanit, Suravee;
> linux@endlessm.com; Craig Stein; michel@daenzer.net; Kuehling, Felix;
> stable@vger.kernel.org; Nath, Arindam
> Subject: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
> 
> From: Arindam Nath <arindam.nath@amd.com>
> 
> Change History
> --------------
> 
> v3:
> - add Fixes and CC tags
> - add link to Bugzilla
> 
> v2: changes suggested by Joerg
> - add flush flag to improve efficiency of flush operation
> 
> v1:
> - The idea behind flush queues is to defer the IOTLB flushing
>   for domains for which the mappings are no longer valid. We
>   add such domains in queue_add(), and when the queue size
>   reaches FLUSH_QUEUE_SIZE, we perform __queue_flush().
> 
>   Since we have already taken lock before __queue_flush()
>   is called, we need to make sure the IOTLB flushing is
>   performed as quickly as possible.
> 
>   In the current implementation, we perform IOTLB flushing
>   for all domains irrespective of which ones were actually
>   added in the flush queue initially. This can be quite
>   expensive especially for domains for which unmapping is
>   not required at this point of time.
> 
>   This patch makes use of domain information in
>   'struct flush_queue_entry' to make sure we only flush
>   IOTLBs for domains who need it, skipping others.
> 
> Bugzilla: https://bugs.freedesktop.org/101029
> Fixes: b1516a14657a ("iommu/amd: Implement flush queue")
> Cc: stable@vger.kernel.org
> Suggested-by: Joerg Roedel <joro@8bytes.org>
> Signed-off-by: Arindam Nath <arindam.nath@amd.com>

Acked-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/iommu/amd_iommu.c       | 27 ++++++++++++++++++++-------
>  drivers/iommu/amd_iommu_types.h |  2 ++
>  2 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 63cacf5..1edeebec 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,26 @@ static struct iommu_group
> *amd_iommu_device_group(struct device *dev)
> 
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -	struct protection_domain *domain;
> -	unsigned long flags;
>  	int idx;
> 
> -	/* First flush TLB of all known domains */
> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -		domain_flush_tlb(domain);
> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +	/* First flush TLB of all domains which were added to flush queue */
> +	for (idx = 0; idx < queue->next; ++idx) {
> +		struct flush_queue_entry *entry;
> +
> +		entry = queue->entries + idx;
> +
> +		/*
> +		 * There might be cases where multiple IOVA entries for the
> +		 * same domain are queued in the flush queue. To avoid
> +		 * flushing the same domain again, we check whether the
> +		 * flag is set or not. This improves the efficiency of
> +		 * flush operation.
> +		 */
> +		if (!entry->dma_dom->domain.already_flushed) {
> +			entry->dma_dom->domain.already_flushed = true;
> +			domain_flush_tlb(&entry->dma_dom->domain);
> +		}
> +	}
> 
>  	/* Wait until flushes have completed */
>  	domain_flush_complete(NULL);
> @@ -2289,6 +2300,8 @@ static void queue_add(struct dma_ops_domain
> *dma_dom,
>  	pages     = __roundup_pow_of_two(pages);
>  	address >>= PAGE_SHIFT;
> 
> +	dma_dom->domain.already_flushed = false;
> +
>  	queue = get_cpu_ptr(&flush_queue);
>  	spin_lock_irqsave(&queue->lock, flags);
> 
> diff --git a/drivers/iommu/amd_iommu_types.h
> b/drivers/iommu/amd_iommu_types.h
> index 4de8f41..4f5519d 100644
> --- a/drivers/iommu/amd_iommu_types.h
> +++ b/drivers/iommu/amd_iommu_types.h
> @@ -454,6 +454,8 @@ struct protection_domain {
>  	bool updated;		/* complete domain flush required */
>  	unsigned dev_cnt;	/* devices assigned to this domain */
>  	unsigned dev_iommu[MAX_IOMMUS]; /* per-IOMMU reference
> count */
> +	bool already_flushed;	/* flag to avoid flushing the same domain
> again
> +				   in a single invocation of __queue_flush() */
>  };
> 
>  /*
> --
> 2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
  2017-05-22  7:48                                                   ` arindam.nath-5C7GfCeVMHo
  (?)
  (?)
@ 2017-05-29 14:38                                                   ` Joerg Roedel
  2017-05-30  7:38                                                     ` Nath, Arindam
  -1 siblings, 1 reply; 41+ messages in thread
From: Joerg Roedel @ 2017-05-29 14:38 UTC (permalink / raw)
  To: arindam.nath, Tom Lendacky
  Cc: iommu, amd-gfx, Alexander.Deucher, John.Bridgman, drake,
	Suravee.Suthikulpanit, linux, Craig Stein, michel,
	Felix.Kuehling, stable

Hi Arindam,

I met Tom Lendacky last week in Nuremberg last week and he told me he is
working on the same area of the code that this patch is for. His reason
for touching this code was to solve some locking problems. Maybe you two
can work together on a joint approach to improve this?

On Mon, May 22, 2017 at 01:18:01PM +0530, arindam.nath@amd.com wrote:
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 63cacf5..1edeebec 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> @@ -2227,15 +2227,26 @@ static struct iommu_group *amd_iommu_device_group(struct device *dev)
>  
>  static void __queue_flush(struct flush_queue *queue)
>  {
> -	struct protection_domain *domain;
> -	unsigned long flags;
>  	int idx;
>  
> -	/* First flush TLB of all known domains */
> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
> -		domain_flush_tlb(domain);
> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
> +	/* First flush TLB of all domains which were added to flush queue */
> +	for (idx = 0; idx < queue->next; ++idx) {
> +		struct flush_queue_entry *entry;
> +
> +		entry = queue->entries + idx;
> +
> +		/*
> +		 * There might be cases where multiple IOVA entries for the
> +		 * same domain are queued in the flush queue. To avoid
> +		 * flushing the same domain again, we check whether the
> +		 * flag is set or not. This improves the efficiency of
> +		 * flush operation.
> +		 */
> +		if (!entry->dma_dom->domain.already_flushed) {
> +			entry->dma_dom->domain.already_flushed = true;
> +			domain_flush_tlb(&entry->dma_dom->domain);
> +		}
> +	}

There is also a race condition here I have to look into. It is not
introduced by your patch, but needs fixing anyway. I'll look into this
too.


Regards,

	Joerg

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
  2017-05-29 14:38                                                   ` Joerg Roedel
@ 2017-05-30  7:38                                                     ` Nath, Arindam
  2017-09-12  6:49                                                         ` Daniel Drake
  0 siblings, 1 reply; 41+ messages in thread
From: Nath, Arindam @ 2017-05-30  7:38 UTC (permalink / raw)
  To: Joerg Roedel, Lendacky, Thomas
  Cc: iommu, amd-gfx, Deucher, Alexander, Bridgman, John, drake,
	Suthikulpanit, Suravee, linux, Craig Stein, michel, Kuehling,
	Felix, stable

>-----Original Message-----
>From: Joerg Roedel [mailto:joro@8bytes.org]
>Sent: Monday, May 29, 2017 8:09 PM
>To: Nath, Arindam <Arindam.Nath@amd.com>; Lendacky, Thomas
><Thomas.Lendacky@amd.com>
>Cc: iommu@lists.linux-foundation.org; amd-gfx@lists.freedesktop.org;
>Deucher, Alexander <Alexander.Deucher@amd.com>; Bridgman, John
><John.Bridgman@amd.com>; drake@endlessm.com; Suthikulpanit, Suravee
><Suravee.Suthikulpanit@amd.com>; linux@endlessm.com; Craig Stein
><stein12c@gmail.com>; michel@daenzer.net; Kuehling, Felix
><Felix.Kuehling@amd.com>; stable@vger.kernel.org
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
>
>Hi Arindam,
>
>I met Tom Lendacky last week in Nuremberg last week and he told me he is
>working on the same area of the code that this patch is for. His reason
>for touching this code was to solve some locking problems. Maybe you two
>can work together on a joint approach to improve this?

Sure Joerg, I will work with Tom.

Thanks.

>
>On Mon, May 22, 2017 at 01:18:01PM +0530, arindam.nath@amd.com wrote:
>> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
>> index 63cacf5..1edeebec 100644
>> --- a/drivers/iommu/amd_iommu.c
>> +++ b/drivers/iommu/amd_iommu.c
>> @@ -2227,15 +2227,26 @@ static struct iommu_group
>*amd_iommu_device_group(struct device *dev)
>>
>>  static void __queue_flush(struct flush_queue *queue)
>>  {
>> -	struct protection_domain *domain;
>> -	unsigned long flags;
>>  	int idx;
>>
>> -	/* First flush TLB of all known domains */
>> -	spin_lock_irqsave(&amd_iommu_pd_lock, flags);
>> -	list_for_each_entry(domain, &amd_iommu_pd_list, list)
>> -		domain_flush_tlb(domain);
>> -	spin_unlock_irqrestore(&amd_iommu_pd_lock, flags);
>> +	/* First flush TLB of all domains which were added to flush queue */
>> +	for (idx = 0; idx < queue->next; ++idx) {
>> +		struct flush_queue_entry *entry;
>> +
>> +		entry = queue->entries + idx;
>> +
>> +		/*
>> +		 * There might be cases where multiple IOVA entries for the
>> +		 * same domain are queued in the flush queue. To avoid
>> +		 * flushing the same domain again, we check whether the
>> +		 * flag is set or not. This improves the efficiency of
>> +		 * flush operation.
>> +		 */
>> +		if (!entry->dma_dom->domain.already_flushed) {
>> +			entry->dma_dom->domain.already_flushed = true;
>> +			domain_flush_tlb(&entry->dma_dom->domain);
>> +		}
>> +	}
>
>There is also a race condition here I have to look into. It is not
>introduced by your patch, but needs fixing anyway. I'll look into this
>too.
>
>
>Regards,
>
>	Joerg

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
@ 2017-09-12  6:49                                                         ` Daniel Drake
  0 siblings, 0 replies; 41+ messages in thread
From: Daniel Drake @ 2017-09-12  6:49 UTC (permalink / raw)
  To: Nath, Arindam
  Cc: Joerg Roedel, Lendacky, Thomas, iommu, amd-gfx, Deucher,
	Alexander, Bridgman, John, Suthikulpanit, Suravee, linux,
	Craig Stein, michel, Kuehling, Felix, stable

Hi,

On Tue, May 30, 2017 at 3:38 PM, Nath, Arindam <Arindam.Nath@amd.com> wrote:
>>-----Original Message-----
>>From: Joerg Roedel [mailto:joro@8bytes.org]
>>Sent: Monday, May 29, 2017 8:09 PM
>>To: Nath, Arindam <Arindam.Nath@amd.com>; Lendacky, Thomas
>><Thomas.Lendacky@amd.com>
>>Cc: iommu@lists.linux-foundation.org; amd-gfx@lists.freedesktop.org;
>>Deucher, Alexander <Alexander.Deucher@amd.com>; Bridgman, John
>><John.Bridgman@amd.com>; drake@endlessm.com; Suthikulpanit, Suravee
>><Suravee.Suthikulpanit@amd.com>; linux@endlessm.com; Craig Stein
>><stein12c@gmail.com>; michel@daenzer.net; Kuehling, Felix
>><Felix.Kuehling@amd.com>; stable@vger.kernel.org
>>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
>>
>>Hi Arindam,
>>
>>I met Tom Lendacky last week in Nuremberg last week and he told me he is
>>working on the same area of the code that this patch is for. His reason
>>for touching this code was to solve some locking problems. Maybe you two
>>can work together on a joint approach to improve this?
>
> Sure Joerg, I will work with Tom.

What was the end result here? I see that the code has been reworked in
4.13 so your original patch no longer applies. Is the reworked version
also expected to solve the original issue?

Thanks
Daniel

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

* Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
@ 2017-09-12  6:49                                                         ` Daniel Drake
  0 siblings, 0 replies; 41+ messages in thread
From: Daniel Drake @ 2017-09-12  6:49 UTC (permalink / raw)
  To: Nath, Arindam
  Cc: Lendacky, Thomas, Bridgman, John, Joerg Roedel,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Craig Stein,
	stable-u79uwXL29TY76Z2rM5mHXA, Suthikulpanit, Suravee, Deucher,
	Alexander, Kuehling, Felix, linux-6IF/jdPJHihWk0Htik3J/w,
	michel-otUistvHUpPR7s880joybQ

Hi,

On Tue, May 30, 2017 at 3:38 PM, Nath, Arindam <Arindam.Nath@amd.com> wrote:
>>-----Original Message-----
>>From: Joerg Roedel [mailto:joro@8bytes.org]
>>Sent: Monday, May 29, 2017 8:09 PM
>>To: Nath, Arindam <Arindam.Nath@amd.com>; Lendacky, Thomas
>><Thomas.Lendacky@amd.com>
>>Cc: iommu@lists.linux-foundation.org; amd-gfx@lists.freedesktop.org;
>>Deucher, Alexander <Alexander.Deucher@amd.com>; Bridgman, John
>><John.Bridgman@amd.com>; drake@endlessm.com; Suthikulpanit, Suravee
>><Suravee.Suthikulpanit@amd.com>; linux@endlessm.com; Craig Stein
>><stein12c@gmail.com>; michel@daenzer.net; Kuehling, Felix
>><Felix.Kuehling@amd.com>; stable@vger.kernel.org
>>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
>>
>>Hi Arindam,
>>
>>I met Tom Lendacky last week in Nuremberg last week and he told me he is
>>working on the same area of the code that this patch is for. His reason
>>for touching this code was to solve some locking problems. Maybe you two
>>can work together on a joint approach to improve this?
>
> Sure Joerg, I will work with Tom.

What was the end result here? I see that the code has been reworked in
4.13 so your original patch no longer applies. Is the reworked version
also expected to solve the original issue?

Thanks
Daniel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
  2017-09-12  6:49                                                         ` Daniel Drake
  (?)
@ 2017-09-12  9:02                                                         ` Nath, Arindam
  -1 siblings, 0 replies; 41+ messages in thread
From: Nath, Arindam @ 2017-09-12  9:02 UTC (permalink / raw)
  To: Daniel Drake
  Cc: Joerg Roedel, Lendacky, Thomas, iommu, amd-gfx, Deucher,
	Alexander, Bridgman, John, Suthikulpanit, Suravee, linux,
	Craig Stein, michel, Kuehling, Felix, stable

Hi Daniel,

>-----Original Message-----
>From: Daniel Drake [mailto:drake@endlessm.com]
>Sent: Tuesday, September 12, 2017 12:20 PM
>To: Nath, Arindam <Arindam.Nath@amd.com>
>Cc: Joerg Roedel <joro@8bytes.org>; Lendacky, Thomas
><Thomas.Lendacky@amd.com>; iommu@lists.linux-foundation.org; amd-
>gfx@lists.freedesktop.org; Deucher, Alexander
><Alexander.Deucher@amd.com>; Bridgman, John
><John.Bridgman@amd.com>; Suthikulpanit, Suravee
><Suravee.Suthikulpanit@amd.com>; linux@endlessm.com; Craig Stein
><stein12c@gmail.com>; michel@daenzer.net; Kuehling, Felix
><Felix.Kuehling@amd.com>; stable@vger.kernel.org
>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only (v3)
>
>Hi,
>
>On Tue, May 30, 2017 at 3:38 PM, Nath, Arindam <Arindam.Nath@amd.com>
>wrote:
>>>-----Original Message-----
>>>From: Joerg Roedel [mailto:joro@8bytes.org]
>>>Sent: Monday, May 29, 2017 8:09 PM
>>>To: Nath, Arindam <Arindam.Nath@amd.com>; Lendacky, Thomas
>>><Thomas.Lendacky@amd.com>
>>>Cc: iommu@lists.linux-foundation.org; amd-gfx@lists.freedesktop.org;
>>>Deucher, Alexander <Alexander.Deucher@amd.com>; Bridgman, John
>>><John.Bridgman@amd.com>; drake@endlessm.com; Suthikulpanit,
>Suravee
>>><Suravee.Suthikulpanit@amd.com>; linux@endlessm.com; Craig Stein
>>><stein12c@gmail.com>; michel@daenzer.net; Kuehling, Felix
>>><Felix.Kuehling@amd.com>; stable@vger.kernel.org
>>>Subject: Re: [PATCH] iommu/amd: flush IOTLB for specific domains only
>(v3)
>>>
>>>Hi Arindam,
>>>
>>>I met Tom Lendacky last week in Nuremberg last week and he told me he is
>>>working on the same area of the code that this patch is for. His reason
>>>for touching this code was to solve some locking problems. Maybe you two
>>>can work together on a joint approach to improve this?
>>
>> Sure Joerg, I will work with Tom.
>
>What was the end result here? I see that the code has been reworked in
>4.13 so your original patch no longer applies. Is the reworked version
>also expected to solve the original issue?

Yes, if the reworked patch resolves the issue, my patch won't be required anymore.

Thanks,
Arindam

>
>Thanks
>Daniel

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

end of thread, other threads:[~2017-09-12  9:03 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 19:49 amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out Daniel Drake
     [not found] ` <CAD8Lp457TE1CnJ-DHnB6NB2LWxgA5K5K57Q6L7XcSHeYNpvARQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-13 20:01   ` Deucher, Alexander
     [not found]     ` <CY4PR12MB16533C83151D6FCFC11ED457F7250-rpdhrqHFk06apTa93KjAaQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-14  6:16       ` Nath, Arindam
2017-03-17 12:15       ` Daniel Drake
     [not found]         ` <CAD8Lp47zjJvqxY3TMMAhjz3OnLR52CtsQh_PQFPmsEW-xHfDwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-17 15:53           ` Alex Deucher
     [not found]             ` <CADnq5_Oyfm-BzU9YV_QLjm6HxtMwnJcFkfYtjmCWpuah35TFvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-21 15:57               ` joro-zLv9SwRftAIdnm+yROfE0A
     [not found]                 ` <20170321155725.GD29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-03-21 16:01                   ` Deucher, Alexander
     [not found]                     ` <BN6PR12MB16526DD4A3B60DB4E20B9907F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-21 16:10                       ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
     [not found]                         ` <20170321161056.GE29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-03-21 16:14                           ` Nath, Arindam
2017-03-21 16:17                           ` Deucher, Alexander
     [not found]                             ` <BN6PR12MB16528AF8E5577E9ACB483212F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-21 16:25                               ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
     [not found]                                 ` <20170321162532.GG29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-03-21 16:30                                   ` Deucher, Alexander
     [not found]                                     ` <BN6PR12MB165268CA4C460215950409D5F73D0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-22 11:22                                       ` 'joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org'
     [not found]                                         ` <20170322112242.GK29659-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-03-22 17:18                                           ` Tom St Denis
     [not found]                                             ` <afecf448-c9fe-c481-0d0e-6dec0f459eeb-5C7GfCeVMHo@public.gmane.org>
2017-03-22 17:26                                               ` Tom St Denis
2017-03-27  6:17                                           ` [PATCH] iommu/amd: flush IOTLB for specific domains only arindam.nath-5C7GfCeVMHo
     [not found]                                             ` <1490595427-11979-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
2017-03-27 12:25                                               ` Daniel Drake
     [not found]                                                 ` <CAD8Lp46RjsUJEvCR5qVY6p8za5H9iDGTAyJMDd1zO7gbgBvqfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-27 12:27                                                   ` Nath, Arindam
2017-03-30  6:23                                                 ` Nath, Arindam
     [not found]                                                   ` <MWHPR12MB15186B0A864F247BFBEF8EAD9C340-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-03-30 13:45                                                     ` Daniel Drake
     [not found]                                                       ` <CAD8Lp47VQ0X0ydsGMrpTu-y4LAXfg9N7+Mzb0hDWDsKc2P-kQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-30 14:48                                                         ` Nath, Arindam
2017-04-05 15:01                                                         ` Nath, Arindam
     [not found]                                                           ` <MWHPR12MB15183AFF01D7D74109CC62FF9C0A0-Gy0DoCVfaSXKu+HfpMNLNQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-05-08 18:22                                                             ` Daniel Drake
2017-04-07 10:20                                               ` Joerg Roedel
     [not found]                                                 ` <20170407102039.GW7266-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2017-05-19  1:31                                                   ` Michel Dänzer
2017-05-19 10:02                                                   ` [PATCH] iommu/amd: flush IOTLB for specific domains only (v2) arindam.nath-5C7GfCeVMHo
     [not found]                                                     ` <1495188151-14358-1-git-send-email-arindam.nath-5C7GfCeVMHo@public.gmane.org>
2017-05-19 13:35                                                       ` Jan Vesely
     [not found]                                                         ` <1495200930.4360.6.camel-kgbqMDwikbSVc3sceRu5cw@public.gmane.org>
2017-05-21  7:25                                                           ` Nath, Arindam
2017-05-22  1:08                                                       ` Michel Dänzer
     [not found]                                                         ` <c03c7d65-52a7-b656-2278-0cfb24e8d07a-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-05-22  1:12                                                           ` Michel Dänzer
2017-05-22  7:48                                                 ` [PATCH] iommu/amd: flush IOTLB for specific domains only (v3) arindam.nath
2017-05-22  7:48                                                   ` arindam.nath-5C7GfCeVMHo
2017-05-23 18:24                                                   ` Deucher, Alexander
2017-05-23 18:24                                                     ` Deucher, Alexander
2017-05-29 14:38                                                   ` Joerg Roedel
2017-05-30  7:38                                                     ` Nath, Arindam
2017-09-12  6:49                                                       ` Daniel Drake
2017-09-12  6:49                                                         ` Daniel Drake
2017-09-12  9:02                                                         ` Nath, Arindam
2017-03-27 12:23                                           ` amd-iommu: can't boot with amdgpu, AMD-Vi: Completion-Wait loop timed out Daniel Drake
2017-03-21 17:22                                   ` Tom St Denis

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.