Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-26 Thread Shuah Khan
On 2/26/21 2:44 PM, Paul Menzel wrote: [cc: +suravee, +jörg] Dear Alex, dear Shuah, dear Suravee, dear Jörg, Am 03.06.20 um 08:54 schrieb Alexander Monakov: On Tue, 2 Jun 2020, Shuah Khan wrote: I changed the logic to read config to get max banks and counters before checking if counters

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-26 Thread Paul Menzel
[cc: +suravee, +jörg] Dear Alex, dear Shuah, dear Suravee, dear Jörg, Am 03.06.20 um 08:54 schrieb Alexander Monakov: On Tue, 2 Jun 2020, Shuah Khan wrote: I changed the logic to read config to get max banks and counters before checking if counters are writable and tried writing to all. The

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-24 Thread Paul Menzel
Dear Suravee, Thank you for your reply. Am 22.02.21 um 18:59 schrieb Suravee Suthikulpanit: This fix has been accepted in the upstream recently. https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/commit/?h=x86/amd Indeed. Linux pulled also pulled this [1]. Could you please

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-22 Thread Suravee Suthikulpanit
This fix has been accepted in the upstream recently. https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/commit/?h=x86/amd Could you please give this a try? Thanks, Suravee On 2/21/21 8:49 PM, Paul Menzel wrote: Dear Suravee, Am 17.09.20 um 19:55 schrieb Alexander Monakov: On

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-21 Thread Paul Menzel
Dear Suravee, Am 17.09.20 um 19:55 schrieb Alexander Monakov: On Tue, 16 Jun 2020, Suravee Suthikulpanit wrote: Instead of blindly moving the code around to a spot that would just work, I am trying to understand what might be required here. In this case, the init_device_table_dma()should not

Re: [PATCH] iommu/amd: Fix event counter availability check

2021-02-21 Thread Paul Menzel
Dear Alexander, Am 01.06.20 um 04:48 schrieb Paul Menzel: […] Am 31.05.20 um 09:22 schrieb Alexander Monakov: Adding Shuah Khan to Cc: I've noticed you've seen this issue on Ryzen 2400GE; can you have a look at the patch? Would be nice to know if it fixes the problem for you too. On

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-09-17 Thread Alexander Monakov
On Tue, 16 Jun 2020, Suravee Suthikulpanit wrote: > > > Instead of blindly moving the code around to a spot that would just work, > > > I am trying to understand what might be required here. In this case, > > > the init_device_table_dma()should not be needed. I suspect it's the IOMMU > > >

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-30 Thread Alexander Monakov
On Tue, 16 Jun 2020, Suravee Suthikulpanit wrote: > > > On 6/1/20 4:01 PM, Alexander Monakov wrote: > > > > On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: > > > > > > > > > > Moving init_iommu_perf_ctr just after iommu_flush_all_caches > > > > > > resolves the issue. This is the earliest point

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-16 Thread Suravee Suthikulpanit
On 6/16/20 3:48 AM, Alexander Monakov wrote: Alexander On 6/1/20 4:01 PM, Alexander Monakov wrote: On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: Moving init_iommu_perf_ctr just after iommu_flush_all_caches resolves the issue. This is the earliest point in amd_iommu_init_pci where the

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-15 Thread Alexander Monakov
On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: > Alexander > > On 6/1/20 4:01 PM, Alexander Monakov wrote: > > On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: > > > > > > Moving init_iommu_perf_ctr just after iommu_flush_all_caches resolves > > > > the issue. This is the earliest point in

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-03 Thread Alexander Monakov
On Tue, 2 Jun 2020, Shuah Khan wrote: > I changed the logic to read config to get max banks and counters > before checking if counters are writable and tried writing to all. > The result is the same and all of them aren't writable. However, > when disable the writable check and assume they are, I

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-02 Thread Shuah Khan
On 5/31/20 1:22 AM, Alexander Monakov wrote: Hi, Adding Shuah Khan to Cc: I've noticed you've seen this issue on Ryzen 2400GE; can you have a look at the patch? Would be nice to know if it fixes the problem for you too. I am not seeing any change in behavior on my system. I still see: I

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-01 Thread Alexander Monakov
> Instead of blindly moving the code around to a spot that would just work, > I am trying to understand what might be required here. In this case, > the init_device_table_dma()should not be needed. I suspect it's the IOMMU > invalidate all command that's also needed here. > > I'm also checking

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-01 Thread Suravee Suthikulpanit
Alexander On 6/1/20 4:01 PM, Alexander Monakov wrote: On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: Moving init_iommu_perf_ctr just after iommu_flush_all_caches resolves the issue. This is the earliest point in amd_iommu_init_pci where the call succeeds on my laptop. According to your

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-01 Thread Alexander Monakov
On Mon, 1 Jun 2020, Suravee Suthikulpanit wrote: > > Moving init_iommu_perf_ctr just after iommu_flush_all_caches resolves > > the issue. This is the earliest point in amd_iommu_init_pci where the > > call succeeds on my laptop. > > According to your description, it should just need to be

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-06-01 Thread Suravee Suthikulpanit
Hi Alexander, On 5/30/20 3:07 AM, Alexander Monakov wrote: The driver performs an extra check if the IOMMU's capabilities advertise presence of performance counters: it verifies that counters are writable by writing a hard-coded value to a counter and testing that reading that counter gives

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-05-31 Thread Paul Menzel
Dear Alexander, Thank you very much for the patch. Am 31.05.20 um 09:22 schrieb Alexander Monakov: Adding Shuah Khan to Cc: I've noticed you've seen this issue on Ryzen 2400GE; can you have a look at the patch? Would be nice to know if it fixes the problem for you too. On Fri, 29 May

Re: [PATCH] iommu/amd: Fix event counter availability check

2020-05-31 Thread Alexander Monakov
Hi, Adding Shuah Khan to Cc: I've noticed you've seen this issue on Ryzen 2400GE; can you have a look at the patch? Would be nice to know if it fixes the problem for you too. Thanks. Alexander On Fri, 29 May 2020, Alexander Monakov wrote: > The driver performs an extra check if the IOMMU's

[PATCH] iommu/amd: Fix event counter availability check

2020-05-29 Thread Alexander Monakov
The driver performs an extra check if the IOMMU's capabilities advertise presence of performance counters: it verifies that counters are writable by writing a hard-coded value to a counter and testing that reading that counter gives back the same value. Unfortunately it does so quite early, even