diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2016-06-02 20:19:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-06-08 06:05:59 -0400 |
commit | 353bf605a771e3c86b21de017e9525aba7d64770 (patch) | |
tree | 59b10d447656a42aaea6082cf47f5b4be9b8af08 | |
parent | 7f2236d0bf9a33bb539551b653ae842430654240 (diff) |
perf/x86/msr: Use Intel family macros for MSR events code
Use the new INTEL_MODEL_* macros for arch/x86/events/msr.c.
This code appears to be missing handling for "WESTMERE2" and
"SKYLAKE_X".
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dave Hansen <dave@sr71.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: jacob.jun.pan@intel.com
Link: http://lkml.kernel.org/r/20160603001933.99A402B0@viggo.jf.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/events/msr.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/arch/x86/events/msr.c b/arch/x86/events/msr.c index 85ef3c2e80e0..83cf13e368cd 100644 --- a/arch/x86/events/msr.c +++ b/arch/x86/events/msr.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/perf_event.h> | 1 | #include <linux/perf_event.h> |
2 | #include <asm/intel-family.h> | ||
2 | 3 | ||
3 | enum perf_msr_id { | 4 | enum perf_msr_id { |
4 | PERF_MSR_TSC = 0, | 5 | PERF_MSR_TSC = 0, |
@@ -34,39 +35,39 @@ static bool test_intel(int idx) | |||
34 | return false; | 35 | return false; |
35 | 36 | ||
36 | switch (boot_cpu_data.x86_model) { | 37 | switch (boot_cpu_data.x86_model) { |
37 | case 30: /* 45nm Nehalem */ | 38 | case INTEL_FAM6_NEHALEM: |
38 | case 26: /* 45nm Nehalem-EP */ | 39 | case INTEL_FAM6_NEHALEM_EP: |
39 | case 46: /* 45nm Nehalem-EX */ | 40 | case INTEL_FAM6_NEHALEM_EX: |
40 | 41 | ||
41 | case 37: /* 32nm Westmere */ | 42 | case INTEL_FAM6_WESTMERE: |
42 | case 44: /* 32nm Westmere-EP */ | 43 | case INTEL_FAM6_WESTMERE_EP: |
43 | case 47: /* 32nm Westmere-EX */ | 44 | case INTEL_FAM6_WESTMERE_EX: |
44 | 45 | ||
45 | case 42: /* 32nm SandyBridge */ | 46 | case INTEL_FAM6_SANDYBRIDGE: |
46 | case 45: /* 32nm SandyBridge-E/EN/EP */ | 47 | case INTEL_FAM6_SANDYBRIDGE_X: |
47 | 48 | ||
48 | case 58: /* 22nm IvyBridge */ | 49 | case INTEL_FAM6_IVYBRIDGE: |
49 | case 62: /* 22nm IvyBridge-EP/EX */ | 50 | case INTEL_FAM6_IVYBRIDGE_X: |
50 | 51 | ||
51 | case 60: /* 22nm Haswell Core */ | 52 | case INTEL_FAM6_HASWELL_CORE: |
52 | case 63: /* 22nm Haswell Server */ | 53 | case INTEL_FAM6_HASWELL_X: |
53 | case 69: /* 22nm Haswell ULT */ | 54 | case INTEL_FAM6_HASWELL_ULT: |
54 | case 70: /* 22nm Haswell + GT3e (Intel Iris Pro graphics) */ | 55 | case INTEL_FAM6_HASWELL_GT3E: |
55 | 56 | ||
56 | case 61: /* 14nm Broadwell Core-M */ | 57 | case INTEL_FAM6_BROADWELL_CORE: |
57 | case 86: /* 14nm Broadwell Xeon D */ | 58 | case INTEL_FAM6_BROADWELL_XEON_D: |
58 | case 71: /* 14nm Broadwell + GT3e (Intel Iris Pro graphics) */ | 59 | case INTEL_FAM6_BROADWELL_GT3E: |
59 | case 79: /* 14nm Broadwell Server */ | 60 | case INTEL_FAM6_BROADWELL_X: |
60 | 61 | ||
61 | case 55: /* 22nm Atom "Silvermont" */ | 62 | case INTEL_FAM6_ATOM_SILVERMONT1: |
62 | case 77: /* 22nm Atom "Silvermont Avoton/Rangely" */ | 63 | case INTEL_FAM6_ATOM_SILVERMONT2: |
63 | case 76: /* 14nm Atom "Airmont" */ | 64 | case INTEL_FAM6_ATOM_AIRMONT: |
64 | if (idx == PERF_MSR_SMI) | 65 | if (idx == PERF_MSR_SMI) |
65 | return true; | 66 | return true; |
66 | break; | 67 | break; |
67 | 68 | ||
68 | case 78: /* 14nm Skylake Mobile */ | 69 | case INTEL_FAM6_SKYLAKE_MOBILE: |
69 | case 94: /* 14nm Skylake Desktop */ | 70 | case INTEL_FAM6_SKYLAKE_DESKTOP: |
70 | if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) | 71 | if (idx == PERF_MSR_SMI || idx == PERF_MSR_PPERF) |
71 | return true; | 72 | return true; |
72 | break; | 73 | break; |