perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
authorKim Phillips <kim.phillips@amd.com>
Tue, 8 Sep 2020 21:47:37 +0000 (16:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:43:23 +0000 (11:43 +0100)
commit2e2a324641f9f70b304d702d3c5b56a232fe78b3
tree85b93ba00a68cf3082bdea1d70f90058dda64340
parentf9a48ff99961cb9c1bbb735066892e37da23f9da
perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()

commit 680d69635005ba0e58fe3f4c52fc162b8fc743b0 upstream.

get_ibs_op_count() adds hardware's current count (IbsOpCurCnt) bits
to its count regardless of hardware's valid status.

According to the PPR for AMD Family 17h Model 31h B0 55803 Rev 0.54,
if the counter rolls over, valid status is set, and the lower 7 bits
of IbsOpCurCnt are randomized by hardware.

Don't include those bits in the driver's event count.

Fixes: 8b1e13638d46 ("perf/x86-ibs: Fix usage of IBS op current count")
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/events/amd/ibs.c