Skip to content

Commit 6f71ee8

Browse files
committed
perf/x86/intel: Switch to new Intel CPU model defines
JIRA: https://issues.redhat.com/browse/RHEL-20059 upstream ======== commit d142df1 Author: Tony Luck <tony.luck@intel.com> Date: Mon May 20 15:46:02 2024 -0700 description =========== New CPU #defines encode vendor and family as well as model. Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://lore.kernel.org/all/20240520224620.9480-32-tony.luck%40intel.com Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 8940922 commit 6f71ee8

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
@@ -4697,8 +4697,8 @@ static void intel_pmu_check_extra_regs(struct extra_reg *extra_regs);
46974697
static inline bool intel_pmu_broken_perf_cap(void)
46984698
{
46994699
/* The Perf Metric (Bit 15) is always cleared */
4700-
if ((boot_cpu_data.x86_model == INTEL_FAM6_METEORLAKE) ||
4701-
(boot_cpu_data.x86_model == INTEL_FAM6_METEORLAKE_L))
4700+
if (boot_cpu_data.x86_vfm == INTEL_METEORLAKE ||
4701+
boot_cpu_data.x86_vfm == INTEL_METEORLAKE_L)
47024702
return true;
47034703

47044704
return false;
@@ -6244,19 +6244,19 @@ __init int intel_pmu_init(void)
62446244
/*
62456245
* Install the hw-cache-events table:
62466246
*/
6247-
switch (boot_cpu_data.x86_model) {
6248-
case INTEL_FAM6_CORE_YONAH:
6247+
switch (boot_cpu_data.x86_vfm) {
6248+
case INTEL_CORE_YONAH:
62496249
pr_cont("Core events, ");
62506250
name = "core";
62516251
break;
62526252

6253-
case INTEL_FAM6_CORE2_MEROM:
6253+
case INTEL_CORE2_MEROM:
62546254
x86_add_quirk(intel_clovertown_quirk);
62556255
fallthrough;
62566256

6257-
case INTEL_FAM6_CORE2_MEROM_L:
6258-
case INTEL_FAM6_CORE2_PENRYN:
6259-
case INTEL_FAM6_CORE2_DUNNINGTON:
6257+
case INTEL_CORE2_MEROM_L:
6258+
case INTEL_CORE2_PENRYN:
6259+
case INTEL_CORE2_DUNNINGTON:
62606260
memcpy(hw_cache_event_ids, core2_hw_cache_event_ids,
62616261
sizeof(hw_cache_event_ids));
62626262

@@ -6268,9 +6268,9 @@ __init int intel_pmu_init(void)
62686268
name = "core2";
62696269
break;
62706270

6271-
case INTEL_FAM6_NEHALEM:
6272-
case INTEL_FAM6_NEHALEM_EP:
6273-
case INTEL_FAM6_NEHALEM_EX:
6271+
case INTEL_NEHALEM:
6272+
case INTEL_NEHALEM_EP:
6273+
case INTEL_NEHALEM_EX:
62746274
memcpy(hw_cache_event_ids, nehalem_hw_cache_event_ids,
62756275
sizeof(hw_cache_event_ids));
62766276
memcpy(hw_cache_extra_regs, nehalem_hw_cache_extra_regs,
@@ -6302,11 +6302,11 @@ __init int intel_pmu_init(void)
63026302
name = "nehalem";
63036303
break;
63046304

6305-
case INTEL_FAM6_ATOM_BONNELL:
6306-
case INTEL_FAM6_ATOM_BONNELL_MID:
6307-
case INTEL_FAM6_ATOM_SALTWELL:
6308-
case INTEL_FAM6_ATOM_SALTWELL_MID:
6309-
case INTEL_FAM6_ATOM_SALTWELL_TABLET:
6305+
case INTEL_ATOM_BONNELL:
6306+
case INTEL_ATOM_BONNELL_MID:
6307+
case INTEL_ATOM_SALTWELL:
6308+
case INTEL_ATOM_SALTWELL_MID:
6309+
case INTEL_ATOM_SALTWELL_TABLET:
63106310
memcpy(hw_cache_event_ids, atom_hw_cache_event_ids,
63116311
sizeof(hw_cache_event_ids));
63126312

@@ -6319,11 +6319,11 @@ __init int intel_pmu_init(void)
63196319
name = "bonnell";
63206320
break;
63216321

6322-
case INTEL_FAM6_ATOM_SILVERMONT:
6323-
case INTEL_FAM6_ATOM_SILVERMONT_D:
6324-
case INTEL_FAM6_ATOM_SILVERMONT_MID:
6325-
case INTEL_FAM6_ATOM_AIRMONT:
6326-
case INTEL_FAM6_ATOM_AIRMONT_MID:
6322+
case INTEL_ATOM_SILVERMONT:
6323+
case INTEL_ATOM_SILVERMONT_D:
6324+
case INTEL_ATOM_SILVERMONT_MID:
6325+
case INTEL_ATOM_AIRMONT:
6326+
case INTEL_ATOM_AIRMONT_MID:
63276327
memcpy(hw_cache_event_ids, slm_hw_cache_event_ids,
63286328
sizeof(hw_cache_event_ids));
63296329
memcpy(hw_cache_extra_regs, slm_hw_cache_extra_regs,
@@ -6341,8 +6341,8 @@ __init int intel_pmu_init(void)
63416341
name = "silvermont";
63426342
break;
63436343

6344-
case INTEL_FAM6_ATOM_GOLDMONT:
6345-
case INTEL_FAM6_ATOM_GOLDMONT_D:
6344+
case INTEL_ATOM_GOLDMONT:
6345+
case INTEL_ATOM_GOLDMONT_D:
63466346
memcpy(hw_cache_event_ids, glm_hw_cache_event_ids,
63476347
sizeof(hw_cache_event_ids));
63486348
memcpy(hw_cache_extra_regs, glm_hw_cache_extra_regs,
@@ -6368,7 +6368,7 @@ __init int intel_pmu_init(void)
63686368
name = "goldmont";
63696369
break;
63706370

6371-
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
6371+
case INTEL_ATOM_GOLDMONT_PLUS:
63726372
memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
63736373
sizeof(hw_cache_event_ids));
63746374
memcpy(hw_cache_extra_regs, glp_hw_cache_extra_regs,
@@ -6397,9 +6397,9 @@ __init int intel_pmu_init(void)
63976397
name = "goldmont_plus";
63986398
break;
63996399

6400-
case INTEL_FAM6_ATOM_TREMONT_D:
6401-
case INTEL_FAM6_ATOM_TREMONT:
6402-
case INTEL_FAM6_ATOM_TREMONT_L:
6400+
case INTEL_ATOM_TREMONT_D:
6401+
case INTEL_ATOM_TREMONT:
6402+
case INTEL_ATOM_TREMONT_L:
64036403
x86_pmu.late_ack = true;
64046404
memcpy(hw_cache_event_ids, glp_hw_cache_event_ids,
64056405
sizeof(hw_cache_event_ids));
@@ -6426,7 +6426,7 @@ __init int intel_pmu_init(void)
64266426
name = "Tremont";
64276427
break;
64286428

6429-
case INTEL_FAM6_ATOM_GRACEMONT:
6429+
case INTEL_ATOM_GRACEMONT:
64306430
intel_pmu_init_grt(NULL);
64316431
intel_pmu_pebs_data_source_grt();
64326432
x86_pmu.pebs_latency_data = adl_latency_data_small;
@@ -6438,8 +6438,8 @@ __init int intel_pmu_init(void)
64386438
name = "gracemont";
64396439
break;
64406440

6441-
case INTEL_FAM6_ATOM_CRESTMONT:
6442-
case INTEL_FAM6_ATOM_CRESTMONT_X:
6441+
case INTEL_ATOM_CRESTMONT:
6442+
case INTEL_ATOM_CRESTMONT_X:
64436443
intel_pmu_init_grt(NULL);
64446444
x86_pmu.extra_regs = intel_cmt_extra_regs;
64456445
intel_pmu_pebs_data_source_cmt();
@@ -6452,9 +6452,9 @@ __init int intel_pmu_init(void)
64526452
name = "crestmont";
64536453
break;
64546454

6455-
case INTEL_FAM6_WESTMERE:
6456-
case INTEL_FAM6_WESTMERE_EP:
6457-
case INTEL_FAM6_WESTMERE_EX:
6455+
case INTEL_WESTMERE:
6456+
case INTEL_WESTMERE_EP:
6457+
case INTEL_WESTMERE_EX:
64586458
memcpy(hw_cache_event_ids, westmere_hw_cache_event_ids,
64596459
sizeof(hw_cache_event_ids));
64606460
memcpy(hw_cache_extra_regs, nehalem_hw_cache_extra_regs,
@@ -6483,8 +6483,8 @@ __init int intel_pmu_init(void)
64836483
name = "westmere";
64846484
break;
64856485

6486-
case INTEL_FAM6_SANDYBRIDGE:
6487-
case INTEL_FAM6_SANDYBRIDGE_X:
6486+
case INTEL_SANDYBRIDGE:
6487+
case INTEL_SANDYBRIDGE_X:
64886488
x86_add_quirk(intel_sandybridge_quirk);
64896489
x86_add_quirk(intel_ht_bug);
64906490
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
@@ -6497,7 +6497,7 @@ __init int intel_pmu_init(void)
64976497
x86_pmu.event_constraints = intel_snb_event_constraints;
64986498
x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints;
64996499
x86_pmu.pebs_aliases = intel_pebs_aliases_snb;
6500-
if (boot_cpu_data.x86_model == INTEL_FAM6_SANDYBRIDGE_X)
6500+
if (boot_cpu_data.x86_vfm == INTEL_SANDYBRIDGE_X)
65016501
x86_pmu.extra_regs = intel_snbep_extra_regs;
65026502
else
65036503
x86_pmu.extra_regs = intel_snb_extra_regs;
@@ -6523,8 +6523,8 @@ __init int intel_pmu_init(void)
65236523
name = "sandybridge";
65246524
break;
65256525

6526-
case INTEL_FAM6_IVYBRIDGE:
6527-
case INTEL_FAM6_IVYBRIDGE_X:
6526+
case INTEL_IVYBRIDGE:
6527+
case INTEL_IVYBRIDGE_X:
65286528
x86_add_quirk(intel_ht_bug);
65296529
memcpy(hw_cache_event_ids, snb_hw_cache_event_ids,
65306530
sizeof(hw_cache_event_ids));
@@ -6540,7 +6540,7 @@ __init int intel_pmu_init(void)
65406540
x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints;
65416541
x86_pmu.pebs_aliases = intel_pebs_aliases_ivb;
65426542
x86_pmu.pebs_prec_dist = true;
6543-
if (boot_cpu_data.x86_model == INTEL_FAM6_IVYBRIDGE_X)
6543+
if (boot_cpu_data.x86_vfm == INTEL_IVYBRIDGE_X)
65446544
x86_pmu.extra_regs = intel_snbep_extra_regs;
65456545
else
65466546
x86_pmu.extra_regs = intel_snb_extra_regs;
@@ -6562,10 +6562,10 @@ __init int intel_pmu_init(void)
65626562
break;
65636563

65646564

6565-
case INTEL_FAM6_HASWELL:
6566-
case INTEL_FAM6_HASWELL_X:
6567-
case INTEL_FAM6_HASWELL_L:
6568-
case INTEL_FAM6_HASWELL_G:
6565+
case INTEL_HASWELL:
6566+
case INTEL_HASWELL_X:
6567+
case INTEL_HASWELL_L:
6568+
case INTEL_HASWELL_G:
65696569
x86_add_quirk(intel_ht_bug);
65706570
x86_add_quirk(intel_pebs_isolation_quirk);
65716571
x86_pmu.late_ack = true;
@@ -6595,10 +6595,10 @@ __init int intel_pmu_init(void)
65956595
name = "haswell";
65966596
break;
65976597

6598-
case INTEL_FAM6_BROADWELL:
6599-
case INTEL_FAM6_BROADWELL_D:
6600-
case INTEL_FAM6_BROADWELL_G:
6601-
case INTEL_FAM6_BROADWELL_X:
6598+
case INTEL_BROADWELL:
6599+
case INTEL_BROADWELL_D:
6600+
case INTEL_BROADWELL_G:
6601+
case INTEL_BROADWELL_X:
66026602
x86_add_quirk(intel_pebs_isolation_quirk);
66036603
x86_pmu.late_ack = true;
66046604
memcpy(hw_cache_event_ids, hsw_hw_cache_event_ids, sizeof(hw_cache_event_ids));
@@ -6637,8 +6637,8 @@ __init int intel_pmu_init(void)
66376637
name = "broadwell";
66386638
break;
66396639

6640-
case INTEL_FAM6_XEON_PHI_KNL:
6641-
case INTEL_FAM6_XEON_PHI_KNM:
6640+
case INTEL_XEON_PHI_KNL:
6641+
case INTEL_XEON_PHI_KNM:
66426642
memcpy(hw_cache_event_ids,
66436643
slm_hw_cache_event_ids, sizeof(hw_cache_event_ids));
66446644
memcpy(hw_cache_extra_regs,
@@ -6657,15 +6657,15 @@ __init int intel_pmu_init(void)
66576657
name = "knights-landing";
66586658
break;
66596659

6660-
case INTEL_FAM6_SKYLAKE_X:
6660+
case INTEL_SKYLAKE_X:
66616661
pmem = true;
66626662
fallthrough;
6663-
case INTEL_FAM6_SKYLAKE_L:
6664-
case INTEL_FAM6_SKYLAKE:
6665-
case INTEL_FAM6_KABYLAKE_L:
6666-
case INTEL_FAM6_KABYLAKE:
6667-
case INTEL_FAM6_COMETLAKE_L:
6668-
case INTEL_FAM6_COMETLAKE:
6663+
case INTEL_SKYLAKE_L:
6664+
case INTEL_SKYLAKE:
6665+
case INTEL_KABYLAKE_L:
6666+
case INTEL_KABYLAKE:
6667+
case INTEL_COMETLAKE_L:
6668+
case INTEL_COMETLAKE:
66696669
x86_add_quirk(intel_pebs_isolation_quirk);
66706670
x86_pmu.late_ack = true;
66716671
memcpy(hw_cache_event_ids, skl_hw_cache_event_ids, sizeof(hw_cache_event_ids));
@@ -6714,16 +6714,16 @@ __init int intel_pmu_init(void)
67146714
name = "skylake";
67156715
break;
67166716

6717-
case INTEL_FAM6_ICELAKE_X:
6718-
case INTEL_FAM6_ICELAKE_D:
6717+
case INTEL_ICELAKE_X:
6718+
case INTEL_ICELAKE_D:
67196719
x86_pmu.pebs_ept = 1;
67206720
pmem = true;
67216721
fallthrough;
6722-
case INTEL_FAM6_ICELAKE_L:
6723-
case INTEL_FAM6_ICELAKE:
6724-
case INTEL_FAM6_TIGERLAKE_L:
6725-
case INTEL_FAM6_TIGERLAKE:
6726-
case INTEL_FAM6_ROCKETLAKE:
6722+
case INTEL_ICELAKE_L:
6723+
case INTEL_ICELAKE:
6724+
case INTEL_TIGERLAKE_L:
6725+
case INTEL_TIGERLAKE:
6726+
case INTEL_ROCKETLAKE:
67276727
x86_pmu.late_ack = true;
67286728
memcpy(hw_cache_event_ids, skl_hw_cache_event_ids, sizeof(hw_cache_event_ids));
67296729
memcpy(hw_cache_extra_regs, skl_hw_cache_extra_regs, sizeof(hw_cache_extra_regs));
@@ -6758,13 +6758,13 @@ __init int intel_pmu_init(void)
67586758
name = "icelake";
67596759
break;
67606760

6761-
case INTEL_FAM6_SAPPHIRERAPIDS_X:
6762-
case INTEL_FAM6_EMERALDRAPIDS_X:
6761+
case INTEL_SAPPHIRERAPIDS_X:
6762+
case INTEL_EMERALDRAPIDS_X:
67636763
x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
67646764
x86_pmu.extra_regs = intel_glc_extra_regs;
67656765
fallthrough;
6766-
case INTEL_FAM6_GRANITERAPIDS_X:
6767-
case INTEL_FAM6_GRANITERAPIDS_D:
6766+
case INTEL_GRANITERAPIDS_X:
6767+
case INTEL_GRANITERAPIDS_D:
67686768
intel_pmu_init_glc(NULL);
67696769
if (!x86_pmu.extra_regs)
67706770
x86_pmu.extra_regs = intel_rwc_extra_regs;
@@ -6782,11 +6782,11 @@ __init int intel_pmu_init(void)
67826782
name = "sapphire_rapids";
67836783
break;
67846784

6785-
case INTEL_FAM6_ALDERLAKE:
6786-
case INTEL_FAM6_ALDERLAKE_L:
6787-
case INTEL_FAM6_RAPTORLAKE:
6788-
case INTEL_FAM6_RAPTORLAKE_P:
6789-
case INTEL_FAM6_RAPTORLAKE_S:
6785+
case INTEL_ALDERLAKE:
6786+
case INTEL_ALDERLAKE_L:
6787+
case INTEL_RAPTORLAKE:
6788+
case INTEL_RAPTORLAKE_P:
6789+
case INTEL_RAPTORLAKE_S:
67906790
/*
67916791
* Alder Lake has 2 types of CPU, core and atom.
67926792
*
@@ -6844,8 +6844,8 @@ __init int intel_pmu_init(void)
68446844
name = "alderlake_hybrid";
68456845
break;
68466846

6847-
case INTEL_FAM6_METEORLAKE:
6848-
case INTEL_FAM6_METEORLAKE_L:
6847+
case INTEL_METEORLAKE:
6848+
case INTEL_METEORLAKE_L:
68496849
intel_pmu_init_hybrid(hybrid_big_small);
68506850

68516851
x86_pmu.pebs_latency_data = mtl_latency_data_small;

0 commit comments

Comments
 (0)