Skip to content

Commit de844ef

Browse files
sohilmehIngo Molnar
authored andcommitted
perf/x86/intel, x86/cpu: Replace Pentium 4 model checks with VFM ones
Introduce a name for an old Pentium 4 model and replace the x86_model checks with VFM ones. This gets rid of one of the last remaining Intel-specific x86_model checks. Signed-off-by: Sohil Mehta <sohil.mehta@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20250318223828.2945651-3-sohil.mehta@intel.com
1 parent 8b70c74 commit de844ef

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

arch/x86/events/intel/p4.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/perf_event.h>
1111

1212
#include <asm/perf_event_p4.h>
13+
#include <asm/cpu_device_id.h>
1314
#include <asm/hardirq.h>
1415
#include <asm/apic.h>
1516

@@ -732,9 +733,9 @@ static bool p4_event_match_cpu_model(unsigned int event_idx)
732733
{
733734
/* INSTR_COMPLETED event only exist for model 3, 4, 6 (Prescott) */
734735
if (event_idx == P4_EVENT_INSTR_COMPLETED) {
735-
if (boot_cpu_data.x86_model != 3 &&
736-
boot_cpu_data.x86_model != 4 &&
737-
boot_cpu_data.x86_model != 6)
736+
if (boot_cpu_data.x86_vfm != INTEL_P4_PRESCOTT &&
737+
boot_cpu_data.x86_vfm != INTEL_P4_PRESCOTT_2M &&
738+
boot_cpu_data.x86_vfm != INTEL_P4_CEDARMILL)
738739
return false;
739740
}
740741

arch/x86/include/asm/intel-family.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
/* Family 15 - NetBurst */
194194
#define INTEL_P4_WILLAMETTE IFM(15, 0x01) /* Also Xeon Foster */
195195
#define INTEL_P4_PRESCOTT IFM(15, 0x03)
196+
#define INTEL_P4_PRESCOTT_2M IFM(15, 0x04)
196197
#define INTEL_P4_CEDARMILL IFM(15, 0x06) /* Also Xeon Dempsey */
197198

198199
/* Family 19 */

0 commit comments

Comments
 (0)