Skip to content

Commit fd636b6

Browse files
silviazhaoPeter Zijlstra
authored andcommitted
x86/perf/zhaoxin: Add stepping check for ZXC
Some of Nano series processors will lead GP when accessing PMC fixed counter. Meanwhile, their hardware support for PMC has not announced externally. So exclude Nano CPUs from ZXC by checking stepping information. This is an unambiguous way to differentiate between ZXC and Nano CPUs. Following are Nano and ZXC FMS information: Nano FMS: Family=6, Model=F, Stepping=[0-A][C-D] ZXC FMS: Family=6, Model=F, Stepping=E-F OR Family=6, Model=0x19, Stepping=0-3 Fixes: 3a4ac12 ("x86/perf: Add hardware performance events support for Zhaoxin CPU.") Reported-by: Arjan <[email protected]> Reported-by: Kevin Brace <[email protected]> Signed-off-by: silviazhao <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=212389
1 parent 89e97eb commit fd636b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/events/zhaoxin/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,13 @@ __init int zhaoxin_pmu_init(void)
541541

542542
switch (boot_cpu_data.x86) {
543543
case 0x06:
544-
if (boot_cpu_data.x86_model == 0x0f || boot_cpu_data.x86_model == 0x19) {
544+
/*
545+
* Support Zhaoxin CPU from ZXC series, exclude Nano series through FMS.
546+
* Nano FMS: Family=6, Model=F, Stepping=[0-A][C-D]
547+
* ZXC FMS: Family=6, Model=F, Stepping=E-F OR Family=6, Model=0x19, Stepping=0-3
548+
*/
549+
if ((boot_cpu_data.x86_model == 0x0f && boot_cpu_data.x86_stepping >= 0x0e) ||
550+
boot_cpu_data.x86_model == 0x19) {
545551

546552
x86_pmu.max_period = x86_pmu.cntval_mask >> 1;
547553

0 commit comments

Comments
 (0)