diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2012-03-27 10:50:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-04-03 02:33:38 -0400 |
commit | 7b8e6da46b921d30ac1553cac56d8fb74f0b431d (patch) | |
tree | c1dde602088af9d02dc10d8d8bed94dcb3a706bb /arch/x86 | |
parent | 6308191f6f55d3629c7dbe72dfb856ad9fa560fd (diff) |
perf/x86/p4: Add format attributes
Steven reported his P4 not booting properly, the missing format
attributes cause a NULL ptr deref. Cure this by adding the
missing format specification.
I took the format description out of the comment near
p4_config_pack*() and hope that comment is still relatively
accurate.
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Reported-by: Bruno Prémont <bonbons@linux-vserver.org>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Lin Ming <ming.m.lin@intel.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1332859842.16159.227.camel@twins
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index ef484d9d0a25..a2dfacfd7103 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -1271,6 +1271,17 @@ done: | |||
1271 | return num ? -EINVAL : 0; | 1271 | return num ? -EINVAL : 0; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | PMU_FORMAT_ATTR(cccr, "config:0-31" ); | ||
1275 | PMU_FORMAT_ATTR(escr, "config:32-62"); | ||
1276 | PMU_FORMAT_ATTR(ht, "config:63" ); | ||
1277 | |||
1278 | static struct attribute *intel_p4_formats_attr[] = { | ||
1279 | &format_attr_cccr.attr, | ||
1280 | &format_attr_escr.attr, | ||
1281 | &format_attr_ht.attr, | ||
1282 | NULL, | ||
1283 | }; | ||
1284 | |||
1274 | static __initconst const struct x86_pmu p4_pmu = { | 1285 | static __initconst const struct x86_pmu p4_pmu = { |
1275 | .name = "Netburst P4/Xeon", | 1286 | .name = "Netburst P4/Xeon", |
1276 | .handle_irq = p4_pmu_handle_irq, | 1287 | .handle_irq = p4_pmu_handle_irq, |
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = { | |||
1305 | * the former idea is taken from OProfile code | 1316 | * the former idea is taken from OProfile code |
1306 | */ | 1317 | */ |
1307 | .perfctr_second_write = 1, | 1318 | .perfctr_second_write = 1, |
1319 | |||
1320 | .format_attrs = intel_p4_formats_attr, | ||
1308 | }; | 1321 | }; |
1309 | 1322 | ||
1310 | __init int p4_pmu_init(void) | 1323 | __init int p4_pmu_init(void) |