diff options
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel.c | 20 | ||||
-rw-r--r-- | kernel/events/core.c | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index dab7580c47ae..cc45deb791b0 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -153,8 +153,14 @@ static struct event_constraint intel_gen_event_constraints[] __read_mostly = | |||
153 | }; | 153 | }; |
154 | 154 | ||
155 | static struct extra_reg intel_snb_extra_regs[] __read_mostly = { | 155 | static struct extra_reg intel_snb_extra_regs[] __read_mostly = { |
156 | INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffffffffull, RSP_0), | 156 | INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3f807f8fffull, RSP_0), |
157 | INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffffffffull, RSP_1), | 157 | INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3f807f8fffull, RSP_1), |
158 | EVENT_EXTRA_END | ||
159 | }; | ||
160 | |||
161 | static struct extra_reg intel_snbep_extra_regs[] __read_mostly = { | ||
162 | INTEL_EVENT_EXTRA_REG(0xb7, MSR_OFFCORE_RSP_0, 0x3fffff8fffull, RSP_0), | ||
163 | INTEL_EVENT_EXTRA_REG(0xbb, MSR_OFFCORE_RSP_1, 0x3fffff8fffull, RSP_1), | ||
158 | EVENT_EXTRA_END | 164 | EVENT_EXTRA_END |
159 | }; | 165 | }; |
160 | 166 | ||
@@ -2097,7 +2103,10 @@ __init int intel_pmu_init(void) | |||
2097 | x86_pmu.event_constraints = intel_snb_event_constraints; | 2103 | x86_pmu.event_constraints = intel_snb_event_constraints; |
2098 | x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints; | 2104 | x86_pmu.pebs_constraints = intel_snb_pebs_event_constraints; |
2099 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; | 2105 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; |
2100 | x86_pmu.extra_regs = intel_snb_extra_regs; | 2106 | if (boot_cpu_data.x86_model == 45) |
2107 | x86_pmu.extra_regs = intel_snbep_extra_regs; | ||
2108 | else | ||
2109 | x86_pmu.extra_regs = intel_snb_extra_regs; | ||
2101 | /* all extra regs are per-cpu when HT is on */ | 2110 | /* all extra regs are per-cpu when HT is on */ |
2102 | x86_pmu.er_flags |= ERF_HAS_RSP_1; | 2111 | x86_pmu.er_flags |= ERF_HAS_RSP_1; |
2103 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; | 2112 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; |
@@ -2123,7 +2132,10 @@ __init int intel_pmu_init(void) | |||
2123 | x86_pmu.event_constraints = intel_ivb_event_constraints; | 2132 | x86_pmu.event_constraints = intel_ivb_event_constraints; |
2124 | x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; | 2133 | x86_pmu.pebs_constraints = intel_ivb_pebs_event_constraints; |
2125 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; | 2134 | x86_pmu.pebs_aliases = intel_pebs_aliases_snb; |
2126 | x86_pmu.extra_regs = intel_snb_extra_regs; | 2135 | if (boot_cpu_data.x86_model == 62) |
2136 | x86_pmu.extra_regs = intel_snbep_extra_regs; | ||
2137 | else | ||
2138 | x86_pmu.extra_regs = intel_snb_extra_regs; | ||
2127 | /* all extra regs are per-cpu when HT is on */ | 2139 | /* all extra regs are per-cpu when HT is on */ |
2128 | x86_pmu.er_flags |= ERF_HAS_RSP_1; | 2140 | x86_pmu.er_flags |= ERF_HAS_RSP_1; |
2129 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; | 2141 | x86_pmu.er_flags |= ERF_NO_HT_SHARING; |
diff --git a/kernel/events/core.c b/kernel/events/core.c index 7e0962ed7f8a..4d3124b39277 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -5331,7 +5331,7 @@ static void sw_perf_event_destroy(struct perf_event *event) | |||
5331 | 5331 | ||
5332 | static int perf_swevent_init(struct perf_event *event) | 5332 | static int perf_swevent_init(struct perf_event *event) |
5333 | { | 5333 | { |
5334 | int event_id = event->attr.config; | 5334 | u64 event_id = event->attr.config; |
5335 | 5335 | ||
5336 | if (event->attr.type != PERF_TYPE_SOFTWARE) | 5336 | if (event->attr.type != PERF_TYPE_SOFTWARE) |
5337 | return -ENOENT; | 5337 | return -ENOENT; |