summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2021-05-04 01:52:36 -0500
committerPeter Zijlstra <peterz@infradead.org>2021-05-06 15:33:37 +0200
commite10de314287c2c14b0e6f0e3e961975ce2f4a83d (patch)
tree0ae4a1c256c6da2acf8bd5bcc6cd81e575fa1a65 /README
parent635de956a7f5a6ffcb04f29d70630c64c717b56b (diff)
downloadlinux-e10de314287c2c14b0e6f0e3e961975ce2f4a83d.tar.gz
linux-e10de314287c2c14b0e6f0e3e961975ce2f4a83d.tar.bz2
linux-e10de314287c2c14b0e6f0e3e961975ce2f4a83d.zip
x86/events/amd/iommu: Fix invalid Perf result due to IOMMU PMC power-gating
On certain AMD platforms, when the IOMMU performance counter source (csource) field is zero, power-gating for the counter is enabled, which prevents write access and returns zero for read access. This can cause invalid perf result especially when event multiplexing is needed (i.e. more number of events than available counters) since the current logic keeps track of the previously read counter value, and subsequently re-program the counter to continue counting the event. With power-gating enabled, we cannot gurantee successful re-programming of the counter. Workaround this issue by : 1. Modifying the ordering of setting/reading counters and enabing/ disabling csources to only access the counter when the csource is set to non-zero. 2. Since AMD IOMMU PMU does not support interrupt mode, the logic can be simplified to always start counting with value zero, and accumulate the counter value when stopping without the need to keep track and reprogram the counter with the previously read counter value. This has been tested on systems with and without power-gating. Fixes: 994d6608efe4 ("iommu/amd: Remove performance counter pre-initialization test") Suggested-by: Alexander Monakov <amonakov@ispras.ru> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20210504065236.4415-1-suravee.suthikulpanit@amd.com
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions