]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf/amd/ibs: Update DTLB/PageSize decode logic
authorRavi Bangoria <ravi.bangoria@amd.com>
Wed, 5 Feb 2025 06:05:42 +0000 (06:05 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Feb 2025 14:20:05 +0000 (15:20 +0100)
commit0b347a4218da08b1eb400c259d193bff463dae87
tree21d738fcb2e8da0bc0379fe9c7bf9acf7c01e816
parentd20610c19b4a22bc69085b7eb7a02741d51de30e
perf/amd/ibs: Update DTLB/PageSize decode logic

IBS Op PMU on Zen5 reports DTLB and page size information differently
compared to prior generation. The change is enumerated by
CPUID_Fn8000001B_EAX[19].

  IBS_OP_DATA3     Zen3/4                 Zen5
  ----------------------------------------------------------------
  19               IbsDcL2TlbHit1G        Reserved
  ----------------------------------------------------------------
   6               IbsDcL2tlbHit2M        Reserved
  ----------------------------------------------------------------
   5               IbsDcL1TlbHit1G        PageSize:
   4               IbsDcL1TlbHit2M          0 - 4K
                                            1 - 2M
                                            2 - 1G
                                            3 - Reserved
                                          Valid only if
                                            IbsDcPhyAddrValid = 1
  ----------------------------------------------------------------
   3               IbsDcL2TlbMiss         IbsDcL2TlbMiss
                                          Valid only if
                                            IbsDcPhyAddrValid = 1
  ----------------------------------------------------------------
   2               IbsDcL1tlbMiss         IbsDcL1tlbMiss
                                          Valid only if
                                            IbsDcPhyAddrValid = 1
  ----------------------------------------------------------------

o Currently, only bit 2 and 3 are interpreted by IBS NMI handler for
  PERF_SAMPLE_DATA_SRC. Add dependency on IbsDcPhyAddrValid for those
  bits.

o Introduce new IBS Op PMU capability and expose it to userspace via
  PMU's sysfs directory.

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250205060547.1337-3-ravi.bangoria@amd.com
arch/x86/events/amd/ibs.c
arch/x86/include/asm/perf_event.h