]> git.ipfire.org Git - thirdparty/linux.git/commit
perf amd ibs: Suppress bogus TlbRefillLat and DCPhysAd on Zen4+
authorRavi Bangoria <ravi.bangoria@amd.com>
Fri, 8 May 2026 06:00:00 +0000 (06:00 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 23 May 2026 00:31:26 +0000 (21:31 -0300)
commitf04a8a7649f9b248f89971b7a440f5d158d57d46
tree2c101f7bb979353ef3cd60c033eb8e14ca52420b
parent540dc628ab5dc2cf176053c9794ed9891269484b
perf amd ibs: Suppress bogus TlbRefillLat and DCPhysAd on Zen4+

On Zen4 (and future) CPUs, IBS_OP_DATA3[TlbRefillLat] is valid only if
IBS_OP_DATA3[DcPhyAddrValid] is set. Similarly, IBS_DC_PHYSADDR is valid
if IBS_OP_DATA3[DcLinAddrValid] is _also_ set. Add these checks while
decoding IBS MSRs.

When IBS is triggered by an unprivileged user, the kernel now zeroes
PhysAddr before storing raw IBS register values in the perf sample. The
perf tool, however, still outputs these zero physical addresses, which
serves no purpose. So avoid printing zero physical addresses.

Instead of explicit family/model checks use the !zen4_ibs_extensions as
a proxy flag to cover Zen 3 and earlier revisions.

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ananth Narayan <ananth.narayan@amd.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Manali Shukla <manali.shukla@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/amd-sample-raw.c