[PATCH] iommu/amd: fix over-read of ACPI UID from IVRS table

2020-05-11 Thread Alexander Monakov
ev entry type HID") Signed-off-by: Alexander Monakov Cc: Joerg Roedel Cc: iommu@lists.linux-foundation.org --- drivers/iommu/amd_iommu_init.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index

AMD IOMMU perf counters on Zen2

2020-05-26 Thread Alexander Monakov
Hello, I'd like to use IOMMU perf counters on a Zen 2 CPU (Ryzen 4500U, Renoir SoC). Unfortunately, init_iommu_perf_ctr fails because val2 != val, i.e. the counter appears not writable. However, if I patch the kernel to skip this check, the counters seem to increment when configured with perf tool

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

2020-05-29 Thread Alexander Monakov
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. Signed-off-by: Alexander Monakov Cc: Joerg Roedel Cc: Suravee Suthikulpanit Cc: iommu@lists.linux-foundation.org --- PS. I'm seeing another hiccup with IOMMU probing on

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 i

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 anywher

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 wit

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

2020-06-02 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-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 > > >

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 > &g

Re: [PATCH] Revert "iommu/amd: Fix performance counter initialization"

2021-03-03 Thread Alexander Monakov
On Wed, 3 Mar 2021, Suravee Suthikulpanit wrote: > > Additionally, alternative proposed solutions [1] were not considered or > > discussed. > > > > [1]:https://lore.kernel.org/linux-iommu/alpine.lnx.2.20.13.2006030935570.3...@monopod.intra.ispras.ru/ > > This check has been introduced early on t

[PATCH] iommu/amd: Fix extended features logging

2021-04-10 Thread Alexander Monakov
with empty format string to set the loglevel for subsequent pr_cont calls. The same solution is used in EFI and uvesafb drivers. Fixes: 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels") Signed-off-by: Alexander Monakov Cc: Paul Menzel Cc: Joerg

Re: [PATCH] iommu/amd: Fix extended features logging

2021-04-11 Thread Alexander Monakov
On Sun, 11 Apr 2021, Paul Menzel wrote: > > The second line is emitted via 'pr_cont', which causes it to have a > > different ('warn') loglevel compared to the previous line ('info'). > > > > Commit 9a295ff0ffc9 attempted to rectify this by removing the newline > > from the pci_info format string

Re: [PATCH] iommu/amd: Fix extended features logging

2021-04-11 Thread Alexander Monakov
On Sun, 11 Apr 2021, Joe Perches wrote: > (cc'ing the printk maintainers) > [snip] > > This shouldn't be necessary. > If this is true then a lot of output logging code broke. See also my response to Paul at https://lore.kernel.org/lkml/alpine.lnx.2.20.13.2104111410340.11...@monopod.intra.ispras

Re: [PATCH] iommu/amd: Fix extended features logging

2021-04-11 Thread Alexander Monakov
On Sun, 11 Apr 2021, John Ogness wrote: > > pr_info("") will also prepend 'AMD-Vi:' to the feature list, which is > > nice. > > I'd rather fix dev_info callers to allow pr_cont and then fix any code > that is using this workaround. Note that existing two users of pr_info("") that I found are not

[PATCH v2] iommu/amd: Fix extended features logging

2021-04-11 Thread Alexander Monakov
AMD-Vi: Interrupt remapping enabled Fixes: 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels") Link: https://lore.kernel.org/lkml/alpine.lnx.2.20.13.2104112326460.11...@monopod.intra.ispras.ru Signed-off-by: Alexander Monakov Cc: Paul Menzel Cc

Re: [PATCH v2] iommu/amd: Fix extended features logging

2021-04-19 Thread Alexander Monakov
On Sun, 11 Apr 2021, Joe Perches wrote: > > v2: avoid pr_info(""), change pci_info() to pr_info() for a nicer > > solution > > > >  drivers/iommu/amd/init.c | 4 ++-- > >  1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c > >

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-20 Thread Alexander Monakov
On Tue, 20 Apr 2021, Suthikulpanit, Suravee wrote: > David / Joerg, > > On 4/10/2021 5:03 PM, David Coe wrote: > > > > The immediately obvious difference is the with the enormous count seen on > > mem_dte_mis on the older Ryzen 2400G. Will do some RTFM but anyone > > with comments and insight? >

[RESEND PATCH v2] iommu/amd: Fix extended features logging

2021-05-04 Thread Alexander Monakov
AMD-Vi: Interrupt remapping enabled Fixes: 9a295ff0ffc9 ("iommu/amd: Print extended features in one line to fix divergent log levels") Link: https://lore.kernel.org/lkml/alpine.lnx.2.20.13.2104112326460.11...@monopod.intra.ispras.ru Signed-off-by: Alexander Monakov Cc: Paul Menzel Cc

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