aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/perf/power7-pmu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 12:58:09 -0500
commit16e024f30ce96ef5fa651e2914e19d175a924cab (patch)
treed68106151a0b36e22625d7af7b23081a48c92e87 /arch/powerpc/perf/power7-pmu.c
parentc36e0501ee91d7616a188efbf9714b1fce150032 (diff)
parent376bddd34433065aeb9b9a140870537feecf90ef (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc update from Benjamin Herrenschmidt: "The main highlight is probably some base POWER8 support. There's more to come such as transactional memory support but that will wait for the next one. Overall it's pretty quiet, or rather I've been pretty poor at picking things up from patchwork and reviewing them this time around and Kumar no better on the FSL side it seems..." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (73 commits) powerpc+of: Rename and fix OF reconfig notifier error inject module powerpc: mpc5200: Add a3m071 board support powerpc/512x: don't compile any platform DIU code if the DIU is not enabled powerpc/mpc52xx: use module_platform_driver macro powerpc+of: Export of_reconfig_notifier_[register,unregister] powerpc/dma/raidengine: add raidengine device powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct powerpc/mpc85xx: Change spin table to cached memory powerpc/fsl-pci: Add PCI controller ATMU PM support powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS] powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers powerpc: Disable relocation on exceptions when kexecing powerpc: Enable relocation on during exceptions at boot powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function powerpc: Add wrappers to enable/disable relocation on exceptions powerpc: Add set_mode hcall powerpc: Setup relocation on exceptions for bare metal systems powerpc: Move initial mfspr LPCR out of __init_LPCR powerpc: Add relocation on exception vector handlers ...
Diffstat (limited to 'arch/powerpc/perf/power7-pmu.c')
-rw-r--r--arch/powerpc/perf/power7-pmu.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 441af08edf43..2ee01e38d5e2 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -54,8 +54,10 @@
54 * Layout of constraint bits: 54 * Layout of constraint bits:
55 * 6666555555555544444444443333333333222222222211111111110000000000 55 * 6666555555555544444444443333333333222222222211111111110000000000
56 * 3210987654321098765432109876543210987654321098765432109876543210 56 * 3210987654321098765432109876543210987654321098765432109876543210
57 * [ ><><><><><><> 57 * < >< ><><><><><><>
58 * NC P6P5P4P3P2P1 58 * L2 NC P6P5P4P3P2P1
59 *
60 * L2 - 16-18 - Required L2SEL value (select field)
59 * 61 *
60 * NC - number of counters 62 * NC - number of counters
61 * 15: NC error 0x8000 63 * 15: NC error 0x8000
@@ -72,7 +74,7 @@
72static int power7_get_constraint(u64 event, unsigned long *maskp, 74static int power7_get_constraint(u64 event, unsigned long *maskp,
73 unsigned long *valp) 75 unsigned long *valp)
74{ 76{
75 int pmc, sh; 77 int pmc, sh, unit;
76 unsigned long mask = 0, value = 0; 78 unsigned long mask = 0, value = 0;
77 79
78 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; 80 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK;
@@ -90,6 +92,15 @@ static int power7_get_constraint(u64 event, unsigned long *maskp,
90 mask |= 0x8000; 92 mask |= 0x8000;
91 value |= 0x1000; 93 value |= 0x1000;
92 } 94 }
95
96 unit = (event >> PM_UNIT_SH) & PM_UNIT_MSK;
97 if (unit == 6) {
98 /* L2SEL must be identical across events */
99 int l2sel = (event >> PM_L2SEL_SH) & PM_L2SEL_MSK;
100 mask |= 0x7 << 16;
101 value |= l2sel << 16;
102 }
103
93 *maskp = mask; 104 *maskp = mask;
94 *valp = value; 105 *valp = value;
95 return 0; 106 return 0;