diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2012-07-23 22:44:10 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-07-26 06:23:14 -0400 |
commit | c1ece48cf7ec07c6b3e093a4036b54bc6078f782 (patch) | |
tree | 0846357c31a128eac588fc7125c7d7f66ef4ecd9 /arch | |
parent | 597ed953d7db28528b4687e46388c1aa905c14bd (diff) |
perf/x86: Fix format definition of SNB-EP uncore QPI box
The event control register of SNB-EP uncore QPI box has a one bit
extension at bit position 21.
Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1343097850-4348-1-git-send-email-zheng.z.yan@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel_uncore.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perf_event_intel_uncore.h | 4 |
2 files changed, 25 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index d9981701bdcf..7563fda9f033 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -18,6 +18,7 @@ static struct event_constraint constraint_empty = | |||
18 | EVENT_CONSTRAINT(0, 0, 0); | 18 | EVENT_CONSTRAINT(0, 0, 0); |
19 | 19 | ||
20 | DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7"); | 20 | DEFINE_UNCORE_FORMAT_ATTR(event, event, "config:0-7"); |
21 | DEFINE_UNCORE_FORMAT_ATTR(event_ext, event, "config:0-7,21"); | ||
21 | DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15"); | 22 | DEFINE_UNCORE_FORMAT_ATTR(umask, umask, "config:8-15"); |
22 | DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18"); | 23 | DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18"); |
23 | DEFINE_UNCORE_FORMAT_ATTR(tid_en, tid_en, "config:19"); | 24 | DEFINE_UNCORE_FORMAT_ATTR(tid_en, tid_en, "config:19"); |
@@ -293,6 +294,15 @@ static struct attribute *snbep_uncore_pcu_formats_attr[] = { | |||
293 | NULL, | 294 | NULL, |
294 | }; | 295 | }; |
295 | 296 | ||
297 | static struct attribute *snbep_uncore_qpi_formats_attr[] = { | ||
298 | &format_attr_event_ext.attr, | ||
299 | &format_attr_umask.attr, | ||
300 | &format_attr_edge.attr, | ||
301 | &format_attr_inv.attr, | ||
302 | &format_attr_thresh8.attr, | ||
303 | NULL, | ||
304 | }; | ||
305 | |||
296 | static struct uncore_event_desc snbep_uncore_imc_events[] = { | 306 | static struct uncore_event_desc snbep_uncore_imc_events[] = { |
297 | INTEL_UNCORE_EVENT_DESC(clockticks, "event=0xff,umask=0x00"), | 307 | INTEL_UNCORE_EVENT_DESC(clockticks, "event=0xff,umask=0x00"), |
298 | INTEL_UNCORE_EVENT_DESC(cas_count_read, "event=0x04,umask=0x03"), | 308 | INTEL_UNCORE_EVENT_DESC(cas_count_read, "event=0x04,umask=0x03"), |
@@ -328,6 +338,11 @@ static struct attribute_group snbep_uncore_pcu_format_group = { | |||
328 | .attrs = snbep_uncore_pcu_formats_attr, | 338 | .attrs = snbep_uncore_pcu_formats_attr, |
329 | }; | 339 | }; |
330 | 340 | ||
341 | static struct attribute_group snbep_uncore_qpi_format_group = { | ||
342 | .name = "format", | ||
343 | .attrs = snbep_uncore_qpi_formats_attr, | ||
344 | }; | ||
345 | |||
331 | static struct intel_uncore_ops snbep_uncore_msr_ops = { | 346 | static struct intel_uncore_ops snbep_uncore_msr_ops = { |
332 | .init_box = snbep_uncore_msr_init_box, | 347 | .init_box = snbep_uncore_msr_init_box, |
333 | .disable_box = snbep_uncore_msr_disable_box, | 348 | .disable_box = snbep_uncore_msr_disable_box, |
@@ -499,8 +514,13 @@ static struct intel_uncore_type snbep_uncore_qpi = { | |||
499 | .num_counters = 4, | 514 | .num_counters = 4, |
500 | .num_boxes = 2, | 515 | .num_boxes = 2, |
501 | .perf_ctr_bits = 48, | 516 | .perf_ctr_bits = 48, |
517 | .perf_ctr = SNBEP_PCI_PMON_CTR0, | ||
518 | .event_ctl = SNBEP_PCI_PMON_CTL0, | ||
519 | .event_mask = SNBEP_QPI_PCI_PMON_RAW_EVENT_MASK, | ||
520 | .box_ctl = SNBEP_PCI_PMON_BOX_CTL, | ||
521 | .ops = &snbep_uncore_pci_ops, | ||
502 | .event_descs = snbep_uncore_qpi_events, | 522 | .event_descs = snbep_uncore_qpi_events, |
503 | SNBEP_UNCORE_PCI_COMMON_INIT(), | 523 | .format_group = &snbep_uncore_qpi_format_group, |
504 | }; | 524 | }; |
505 | 525 | ||
506 | 526 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h index 47b1776a858b..f3851892e077 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h | |||
@@ -113,6 +113,10 @@ | |||
113 | SNBEP_PCU_MSR_PMON_CTL_OCC_INVERT | \ | 113 | SNBEP_PCU_MSR_PMON_CTL_OCC_INVERT | \ |
114 | SNBEP_PCU_MSR_PMON_CTL_OCC_EDGE_DET) | 114 | SNBEP_PCU_MSR_PMON_CTL_OCC_EDGE_DET) |
115 | 115 | ||
116 | #define SNBEP_QPI_PCI_PMON_RAW_EVENT_MASK \ | ||
117 | (SNBEP_PMON_RAW_EVENT_MASK | \ | ||
118 | SNBEP_PMON_CTL_EV_SEL_EXT) | ||
119 | |||
116 | /* SNB-EP pci control register */ | 120 | /* SNB-EP pci control register */ |
117 | #define SNBEP_PCI_PMON_BOX_CTL 0xf4 | 121 | #define SNBEP_PCI_PMON_BOX_CTL 0xf4 |
118 | #define SNBEP_PCI_PMON_CTL0 0xd8 | 122 | #define SNBEP_PCI_PMON_CTL0 0xd8 |