perf/x86/rapl: Only check lower 32bits for RAPL energy counters
authorZhang Rui <rui.zhang@intel.com>
Thu, 4 Feb 2021 16:18:15 +0000 (00:18 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 10 Feb 2021 13:44:55 +0000 (14:44 +0100)
commitb6f78d3fba7f605f673185d7292d84af7576fdc1
tree506e0d20ec825365d6b9fc8686eb99d0a0e98192
parentffb20c2e52e8709b5fc9951e8863e31efb1f2cba
perf/x86/rapl: Only check lower 32bits for RAPL energy counters

In the RAPL ENERGY_COUNTER MSR, only the lower 32bits represent the energy
counter.

On previous platforms, the higher 32bits are reverved and always return
Zero. But on Intel SapphireRapids platform, the higher 32bits are reused
for other purpose and return non-zero value.

Thus check the lower 32bits only for these ENERGY_COUTNER MSRs, to make
sure the RAPL PMU events are not added erroneously when higher 32bits
contain non-zero value.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: https://lkml.kernel.org/r/20210204161816.12649-2-rui.zhang@intel.com
arch/x86/events/rapl.c