Skip to content

Commit d142df1

Browse files
aeglhansendc
authored andcommitted
perf/x86/intel: Switch to new Intel CPU model defines
New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/20240520224620.9480-32-tony.luck%40intel.com
1 parent 189e8d4 commit d142df1

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

arch/x86/events/intel/core.c

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4698,8 +4698,8 @@ static void intel_pmu_check_extra_regs(struct extra_reg *extra_regs);
46984698
static inline bool intel_pmu_broken_perf_cap(void)
46994699
{
47004700
/* The Perf Metric (Bit 15) is always cleared */
4701-
if ((boot_cpu_data.x86_model == INTEL_FAM6_METEORLAKE) ||
4702-
(boot_cpu_data.x86_model == INTEL_FAM6_METEORLAKE_L))
4701+
if (boot_cpu_data.x86_vfm == INTEL_METEORLAKE ||
4702+
boot_cpu_data.x86_vfm == INTEL_METEORLAKE_L)
47034703
return true;
47044704

47054705
return false;
@@ -6238,19 +6238,19 @@ __init int intel_pmu_init(void)
62386238
/*
62396239
* Install the hw-cache-events table:
62406240
*/
6241-
switch (boot_cpu_data.x86_model) {
6242-
case INTEL_FAM6_CORE_YONAH:
6241+
switch (boot_cpu_data.x86_vfm) {
6242+
case INTEL_CORE_YONAH:
62436243
pr_cont("Core events, ");
62446244
name = "core";
62456245
break;
62466246

6247-
case INTEL_FAM6_CORE2_MEROM:
6247+
case INTEL_CORE2_MEROM:
62486248
x86_add_quirk(intel_clovertown_quirk);
62496249
fallthrough;
62506250

6251-
case INTEL_FAM6_CORE2_MEROM_L:
6252-
case INTEL_FAM6_CORE2_PENRYN:
6253-
case INTEL_FAM6_CORE2_DUNNINGTON:
6251+
case INTEL_CORE2_MEROM_L:
6252+
case INTEL_CORE2_PENRYN:
6253+
case INTEL_CORE2_DUNNINGTON:
62546254
memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
62556255
sizeof(hw_cache_event_ids));
62566256

@@ -6262,9 +6262,9 @@ __init int intel_pmu_init(void)
62626262
name = "core2";
62636263
break;
62646264

6265-
case INTEL_FAM6_NEHALEM:
6266-
case INTEL_FAM6_NEHALEM_EP:
6267-
case INTEL_FAM6_NEHALEM_EX:
6265+
case INTEL_NEHALEM:
6266+
case INTEL_NEHALEM_EP:
6267+
case INTEL_NEHALEM_EX:
62686268
memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
62696269
sizeof(hw_cache_event_ids));
62706270
memcpy(hw_cache_extra_regs, nehalem_hw_cache_extra_regs,
@@ -6296,11 +6296,11 @@ __init int intel_pmu_init(void)
62966296
name = "nehalem";
62976297
break;
62986298

6299-
case INTEL_FAM6_ATOM_BONNELL:
6300-
case INTEL_FAM6_ATOM_BONNELL_MID:
6301-
case INTEL_FAM6_ATOM_SALTWELL:
6302-
case INTEL_FAM6_ATOM_SALTWELL_MID:
6303-
case INTEL_FAM6_ATOM_SALTWELL_TABLET:
6299+
case INTEL_ATOM_BONNELL:
6300+
case INTEL_ATOM_BONNELL_MID:
6301+
case INTEL_ATOM_SALTWELL:
6302+
case INTEL_ATOM_SALTWELL_MID:
6303+
case INTEL_ATOM_SALTWELL_TABLET:
63046304
memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
63056305
sizeof(hw_cache_event_ids));
63066306

@@ -6313,11 +6313,11 @@ __init int intel_pmu_init(void)
63136313
name = "bonnell";
63146314
break;
63156315

6316-
case INTEL_FAM6_ATOM_SILVERMONT:
6317-
case INTEL_FAM6_ATOM_SILVERMONT_D:
6318-
case INTEL_FAM6_ATOM_SILVERMONT_MID:
6319-
case INTEL_FAM6_ATOM_AIRMONT:
6320-
case INTEL_FAM6_ATOM_AIRMONT_MID:
6316+
case INTEL_ATOM_SILVERMONT:
6317+
case INTEL_ATOM_SILVERMONT_D:
6318+
case INTEL_ATOM_SILVERMONT_MID:
6319+
case INTEL_ATOM_AIRMONT:
6320+
case INTEL_ATOM_AIRMONT_MID:
63216321
memcpy(hw_cache_event_ids, slm_hw_cache_event_ids,
63226322
sizeof(hw_cache_event_ids));
63236323
memcpy(hw_cache_extra_regs, slm_hw_cache_extra_regs,
@@ -6335,8 +6335,8 @@ __init int intel_pmu_init(void)
63356335
name = "silvermont";
63366336
break;
63376337

6338-
case INTEL_FAM6_ATOM_GOLDMONT:
6339-
case INTEL_FAM6_ATOM_GOLDMONT_D:
6338+
case INTEL_ATOM_GOLDMONT:
6339+
case INTEL_ATOM_GOLDMONT_D:
63406340
memcpy(hw_cache_event_ids, glm_hw_cache_event_ids,
63416341
sizeof(hw_cache_event_ids));
63426342
memcpy(hw_cache_extra_regs, glm_hw_cache_extra_regs,
@@ -6362,7 +6362,7 @@ __init int intel_pmu_init(void)
63626362
name = "goldmont";
63636363
break;
63646364

6365-
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
6365+
case INTEL_ATOM_GOLDMONT_PLUS:
63666366
memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
63676367
sizeof(hw_cache_event_ids));
63686368
memcpy(hw_cache_extra_regs, glp_hw_cache_extra_regs,
@@ -6391,9 +6391,9 @@ __init int intel_pmu_init(void)
63916391
name = "goldmont_plus";
63926392
break;
63936393

6394-
case INTEL_FAM6_ATOM_TREMONT_D:
6395-
case INTEL_FAM6_ATOM_TREMONT:
6396-
case INTEL_FAM6_ATOM_TREMONT_L:
6394+
case INTEL_ATOM_TREMONT_D:
6395+
case INTEL_ATOM_TREMONT:
6396+
case INTEL_ATOM_TREMONT_L:
63976397
x86_pmu.late_ack = true;
63986398
memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
63996399
sizeof(hw_cache_event_ids));
@@ -6420,7 +6420,7 @@ __init int intel_pmu_init(void)
64206420
name = "Tremont";
64216421
break;
64226422

6423-
case INTEL_FAM6_ATOM_GRACEMONT:
6423+
case INTEL_ATOM_GRACEMONT:
64246424
intel_pmu_init_grt(NULL);
64256425
intel_pmu_pebs_data_source_grt();
64266426
x86_pmu.pebs_latency_data = adl_latency_data_small;
@@ -6432,8 +6432,8 @@ __init int intel_pmu_init(void)
64326432
name = "gracemont";
64336433
break;
64346434

6435-
case INTEL_FAM6_ATOM_CRESTMONT:
6436-
case INTEL_FAM6_ATOM_CRESTMONT_X:
6435+
case INTEL_ATOM_CRESTMONT:
6436+
case INTEL_ATOM_CRESTMONT_X:
64376437
intel_pmu_init_grt(NULL);
64386438
x86_pmu.extra_regs = intel_cmt_extra_regs;
64396439
intel_pmu_pebs_data_source_cmt();
@@ -6446,9 +6446,9 @@ __init int intel_pmu_init(void)
64466446
name = "crestmont";
64476447
break;
64486448

6449-
case INTEL_FAM6_WESTMERE:
6450-
case INTEL_FAM6_WESTMERE_EP:
6451-
case INTEL_FAM6_WESTMERE_EX:
6449+
case INTEL_WESTMERE:
6450+
case INTEL_WESTMERE_EP:
6451+
case INTEL_WESTMERE_EX:
64526452
memcpy(hw_cache_event_ids, westmere_hw_cache_event_ids,
64536453
sizeof(hw_cache_event_ids));
64546454
memcpy(hw_cache_extra_regs, nehalem_hw_cache_extra_regs,
@@ -6477,8 +6477,8 @@ __init int intel_pmu_init(void)
64776477
name = "westmere";
64786478
break;
64796479

6480-
case INTEL_FAM6_SANDYBRIDGE:
6481-
case INTEL_FAM6_SANDYBRIDGE_X:
6480+
case INTEL_SANDYBRIDGE:
6481+
case INTEL_SANDYBRIDGE_X:
64826482
x86_add_quirk(intel_sandybridge_quirk);
64836483
x86_add_quirk(intel_ht_bug);
64846484
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
@@ -6491,7 +6491,7 @@ __init int intel_pmu_init(void)
64916491
x86_pmu.event_constraints = intel_snb_event_constraints;
64926492
x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints;
64936493
x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
6494-
if (boot_cpu_data.x86_model == INTEL_FAM6_SANDYBRIDGE_X)
6494+
if (boot_cpu_data.x86_vfm == INTEL_SANDYBRIDGE_X)
64956495
x86_pmu.extra_regs = intel_snbep_extra_regs;
64966496
else
64976497
x86_pmu.extra_regs = intel_snb_extra_regs;
@@ -6517,8 +6517,8 @@ __init int intel_pmu_init(void)
65176517
name = "sandybridge";
65186518
break;
65196519

6520-
case INTEL_FAM6_IVYBRIDGE:
6521-
case INTEL_FAM6_IVYBRIDGE_X:
6520+
case INTEL_IVYBRIDGE:
6521+
case INTEL_IVYBRIDGE_X:
65226522
x86_add_quirk(intel_ht_bug);
65236523
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
65246524
sizeof(hw_cache_event_ids));
@@ -6534,7 +6534,7 @@ __init int intel_pmu_init(void)
65346534
x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints;
65356535
x86_pmu.pebs_aliases = intel_pebs_aliases_ivb;
65366536
x86_pmu.pebs_prec_dist = true;
6537-
if (boot_cpu_data.x86_model == INTEL_FAM6_IVYBRIDGE_X)
6537+
if (boot_cpu_data.x86_vfm == INTEL_IVYBRIDGE_X)
65386538
x86_pmu.extra_regs = intel_snbep_extra_regs;
65396539
else
65406540
x86_pmu.extra_regs = intel_snb_extra_regs;
@@ -6556,10 +6556,10 @@ __init int intel_pmu_init(void)
65566556
break;
65576557

65586558

6559-
case INTEL_FAM6_HASWELL:
6560-
case INTEL_FAM6_HASWELL_X:
6561-
case INTEL_FAM6_HASWELL_L:
6562-
case INTEL_FAM6_HASWELL_G:
6559+
case INTEL_HASWELL:
6560+
case INTEL_HASWELL_X:
6561+
case INTEL_HASWELL_L:
6562+
case INTEL_HASWELL_G:
65636563
x86_add_quirk(intel_ht_bug);
65646564
x86_add_quirk(intel_pebs_isolation_quirk);
65656565
x86_pmu.late_ack = true;
@@ -6589,10 +6589,10 @@ __init int intel_pmu_init(void)
65896589
name = "haswell";
65906590
break;
65916591

6592-
case INTEL_FAM6_BROADWELL:
6593-
case INTEL_FAM6_BROADWELL_D:
6594-
case INTEL_FAM6_BROADWELL_G:
6595-
case INTEL_FAM6_BROADWELL_X:
6592+
case INTEL_BROADWELL:
6593+
case INTEL_BROADWELL_D:
6594+
case INTEL_BROADWELL_G:
6595+
case INTEL_BROADWELL_X:
65966596
x86_add_quirk(intel_pebs_isolation_quirk);
65976597
x86_pmu.late_ack = true;
65986598
memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids));
@@ -6631,8 +6631,8 @@ __init int intel_pmu_init(void)
66316631
name = "broadwell";
66326632
break;
66336633

6634-
case INTEL_FAM6_XEON_PHI_KNL:
6635-
case INTEL_FAM6_XEON_PHI_KNM:
6634+
case INTEL_XEON_PHI_KNL:
6635+
case INTEL_XEON_PHI_KNM:
66366636
memcpy(hw_cache_event_ids,
66376637
slm_hw_cache_event_ids, sizeof(hw_cache_event_ids));
66386638
memcpy(hw_cache_extra_regs,
@@ -6651,15 +6651,15 @@ __init int intel_pmu_init(void)
66516651
name = "knights-landing";
66526652
break;
66536653

6654-
case INTEL_FAM6_SKYLAKE_X:
6654+
case INTEL_SKYLAKE_X:
66556655
pmem = true;
66566656
fallthrough;
6657-
case INTEL_FAM6_SKYLAKE_L:
6658-
case INTEL_FAM6_SKYLAKE:
6659-
case INTEL_FAM6_KABYLAKE_L:
6660-
case INTEL_FAM6_KABYLAKE:
6661-
case INTEL_FAM6_COMETLAKE_L:
6662-
case INTEL_FAM6_COMETLAKE:
6657+
case INTEL_SKYLAKE_L:
6658+
case INTEL_SKYLAKE:
6659+
case INTEL_KABYLAKE_L:
6660+
case INTEL_KABYLAKE:
6661+
case INTEL_COMETLAKE_L:
6662+
case INTEL_COMETLAKE:
66636663
x86_add_quirk(intel_pebs_isolation_quirk);
66646664
x86_pmu.late_ack = true;
66656665
memcpy(hw_cache_event_ids, skl_hw_cache_event_ids, sizeof(hw_cache_event_ids));
@@ -6708,16 +6708,16 @@ __init int intel_pmu_init(void)
67086708
name = "skylake";
67096709
break;
67106710

6711-
case INTEL_FAM6_ICELAKE_X:
6712-
case INTEL_FAM6_ICELAKE_D:
6711+
case INTEL_ICELAKE_X:
6712+
case INTEL_ICELAKE_D:
67136713
x86_pmu.pebs_ept = 1;
67146714
pmem = true;
67156715
fallthrough;
6716-
case INTEL_FAM6_ICELAKE_L:
6717-
case INTEL_FAM6_ICELAKE:
6718-
case INTEL_FAM6_TIGERLAKE_L:
6719-
case INTEL_FAM6_TIGERLAKE:
6720-
case INTEL_FAM6_ROCKETLAKE:
6716+
case INTEL_ICELAKE_L:
6717+
case INTEL_ICELAKE:
6718+
case INTEL_TIGERLAKE_L:
6719+
case INTEL_TIGERLAKE:
6720+
case INTEL_ROCKETLAKE:
67216721
x86_pmu.late_ack = true;
67226722
memcpy(hw_cache_event_ids, skl_hw_cache_event_ids, sizeof(hw_cache_event_ids));
67236723
memcpy(hw_cache_extra_regs, skl_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
@@ -6752,13 +6752,13 @@ __init int intel_pmu_init(void)
67526752
name = "icelake";
67536753
break;
67546754

6755-
case INTEL_FAM6_SAPPHIRERAPIDS_X:
6756-
case INTEL_FAM6_EMERALDRAPIDS_X:
6755+
case INTEL_SAPPHIRERAPIDS_X:
6756+
case INTEL_EMERALDRAPIDS_X:
67576757
x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
67586758
x86_pmu.extra_regs = intel_glc_extra_regs;
67596759
fallthrough;
6760-
case INTEL_FAM6_GRANITERAPIDS_X:
6761-
case INTEL_FAM6_GRANITERAPIDS_D:
6760+
case INTEL_GRANITERAPIDS_X:
6761+
case INTEL_GRANITERAPIDS_D:
67626762
intel_pmu_init_glc(NULL);
67636763
if (!x86_pmu.extra_regs)
67646764
x86_pmu.extra_regs = intel_rwc_extra_regs;
@@ -6776,11 +6776,11 @@ __init int intel_pmu_init(void)
67766776
name = "sapphire_rapids";
67776777
break;
67786778

6779-
case INTEL_FAM6_ALDERLAKE:
6780-
case INTEL_FAM6_ALDERLAKE_L:
6781-
case INTEL_FAM6_RAPTORLAKE:
6782-
case INTEL_FAM6_RAPTORLAKE_P:
6783-
case INTEL_FAM6_RAPTORLAKE_S:
6779+
case INTEL_ALDERLAKE:
6780+
case INTEL_ALDERLAKE_L:
6781+
case INTEL_RAPTORLAKE:
6782+
case INTEL_RAPTORLAKE_P:
6783+
case INTEL_RAPTORLAKE_S:
67846784
/*
67856785
* Alder Lake has 2 types of CPU, core and atom.
67866786
*
@@ -6838,8 +6838,8 @@ __init int intel_pmu_init(void)
68386838
name = "alderlake_hybrid";
68396839
break;
68406840

6841-
case INTEL_FAM6_METEORLAKE:
6842-
case INTEL_FAM6_METEORLAKE_L:
6841+
case INTEL_METEORLAKE:
6842+
case INTEL_METEORLAKE_L:
68436843
intel_pmu_init_hybrid(hybrid_big_small);
68446844

68456845
x86_pmu.pebs_latency_data = mtl_latency_data_small;

0 commit comments

Comments
 (0)