perf/amd/uncore: Add support for Family 19h L3 PMU
authorKim Phillips <kim.phillips@amd.com>
Fri, 13 Mar 2020 23:10:24 +0000 (18:10 -0500)
committerBorislav Petkov <bp@suse.de>
Tue, 17 Mar 2020 12:01:03 +0000 (13:01 +0100)
commite48667b865480d8bf0f1171a8b474ffc785b9ace
tree3b8ab0aaff082194598a2fcae3535dc4814d9bce
parent9689dbbeaea884d19e3085439c6a247ef986b2af
perf/amd/uncore: Add support for Family 19h L3 PMU

Family 19h introduces change in slice, core and thread specification in
its L3 Performance Event Select (ChL3PmcCfg) h/w register. The change is
incompatible with Family 17h's version of the register.

Introduce a new path in l3_thread_slice_mask() to do things differently
for Family 19h vs. Family 17h, otherwise the new hardware doesn't get
programmed correctly.

Instead of a linear core--thread bitmask, Family 19h takes an encoded
core number, and a separate thread mask. There are new bits that are set
for all cores and all slices, of which only the latter is used, since
the driver counts events for all slices on behalf of the specified CPU.

Also update amd_uncore_init() to base its L2/NB vs. L3/Data Fabric mode
decision based on Family 17h or above, not just 17h and 18h: the Family
19h Data Fabric PMC is compatible with the Family 17h DF PMC.

 [ bp: Touchups. ]

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200313231024.17601-3-kim.phillips@amd.com
arch/x86/events/amd/uncore.c
arch/x86/include/asm/perf_event.h