alistair23-linux/arch/powerpc/platforms/pseries
Paul Mackerras a6dbf93a2a powerpc: Fix bug where perf_counters breaks oprofile
Currently there is a bug where if you use oprofile on a pSeries
machine, then use perf_counters, then use oprofile again, oprofile
will not work correctly; it will lose the PMU configuration the next
time the hypervisor does a partition context switch, and thereafter
won't count anything.

Maynard Johnson identified the sequence causing the problem:
- oprofile setup calls ppc_enable_pmcs(), which calls
  pseries_lpar_enable_pmcs, which tells the hypervisor that we want
  to use the PMU, and sets the "PMU in use" flag in the lppaca.
  This flag tells the hypervisor whether it needs to save and restore
  the PMU config.
- The perf_counter code sets and clears the "PMU in use" flag directly
  as it context-switches the PMU between tasks, and leaves it clear
  when it finishes.
- oprofile setup, called for a new oprofile run, calls ppc_enable_pmcs,
  which does nothing because it has already been called.  In particular
  it doesn't set the "PMU in use" flag.

This fixes the problem by arranging for ppc_enable_pmcs to always set
the "PMU in use" flag.  It makes the perf_counter code call
ppc_enable_pmcs also rather than calling the lower-level function
directly, and removes the setting of the "PMU in use" flag from
pseries_lpar_enable_pmcs, since that is now done in its caller.

This also removes the declaration of pasemi_enable_pmcs because it
isn't defined anywhere.

Reported-by: Maynard Johnson <mpjohn@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: <stable@kernel.org)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-09-11 11:27:58 +10:00
..
cmm.c powerpc: Add reboot notifier to Collaborative Memory Manager 2008-12-21 14:21:15 +11:00
dtl.c powerpc: pseries/dtl.c should include asm/firmware.h 2009-04-15 15:23:55 +10:00
eeh.c powerpc/eeh: Make EEH device add/remove more robust 2008-11-06 09:25:15 +11:00
eeh_cache.c [POWERPC] Add CONFIG_PPC_PSERIES_DEBUG to enable debugging for platforms/pseries 2008-04-24 21:08:12 +10:00
eeh_driver.c PCI AER: support Multiple Error Received and no error source id 2009-06-16 14:30:13 -07:00
eeh_event.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
eeh_sysfs.c [POWERPC] Show EEH per-device false positives 2007-06-14 22:29:55 +10:00
firmware.c [POWERPC] pseries/firmware.c should include pseries/pseries.h 2008-05-14 22:32:00 +10:00
hotplug-cpu.c powerpc/pseries: Fix cpu hotplug 2008-12-23 15:13:27 +11:00
hotplug-memory.c powerpc: Add missing sparsemem.h include 2009-02-10 14:39:09 +11:00
hvCall.S [POWERPC] Bypass hcall stats until cpu features have run 2007-03-22 15:01:43 +11:00
hvCall_inst.c [PATCH] mark struct file_operations const 2 2007-02-12 09:48:44 -08:00
hvconsole.c [POWERPC] clean up pseries hcall interfaces 2006-08-01 16:19:15 +10:00
hvcserver.c [PATCH] powerpc/pseries: Change H_StudlyCaps to H_SHOUTING_CAPS 2006-04-01 22:36:57 +11:00
iommu.c powerpc/pseries: Fix warnings when printing resource_size_t 2009-06-09 16:47:39 +10:00
Kconfig powerpc: Add virtual processor dispatch trace log 2009-03-24 13:47:28 +11:00
kexec.c powerpc/pseries: Call pseries_kexec_setup only on pseries 2008-06-30 22:30:57 +10:00
lpar.c powerpc/pseries: Use pr_devel() in pseries LPAR HPTE routines 2009-07-08 13:50:21 +10:00
Makefile powerpc: Add virtual processor dispatch trace log 2009-03-24 13:47:28 +11:00
msi.c powerpc/pseries: Reject discontiguous/non-zero based MSI-X requests 2009-03-11 17:11:33 +11:00
nvram.c [POWERPC] Add missing of_node_put in pseries/nvram.c 2008-06-16 15:00:32 +10:00
pci.c [POWERPC] Rename get_property to of_get_property: arch/powerpc 2007-04-13 03:55:19 +10:00
pci_dlpar.c powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan() 2009-09-02 15:45:53 +10:00
phyp_dump.c powerpc: Printing fix for l64 to ll64 conversion: phyp_dump.c 2009-01-28 17:15:51 +11:00
plpar_wrappers.h powerpc: Add virtual processor dispatch trace log 2009-03-24 13:47:28 +11:00
power.c [POWERPC] Fix warning in pseries/power.c 2008-02-20 13:33:37 +11:00
pseries.h [POWERPC] Move prototype for find_udbg_vterm() into a header file 2008-04-17 10:00:59 +10:00
ras.c [POWERPC] Fix sparse warnings in arch/powerpc/platforms/pseries 2008-05-14 22:32:02 +10:00
reconfig.c powerpc/pseries: Fix to handle slb resize across migration 2009-09-02 16:19:01 +10:00
rtasd.c powerpc: Convert RTAS event scan from kernel thread to workqueue 2009-06-02 10:35:32 +10:00
scanlog.c [POWERPC] Assign PDE->data before gluing PDE into /proc tree 2008-05-05 16:47:14 +10:00
setup.c powerpc: Fix bug where perf_counters breaks oprofile 2009-09-11 11:27:58 +10:00
smp.c powerpc: Move definitions of secondary CPU spinloop to header file 2009-08-20 10:12:44 +10:00
xics.c powerpc/pseries: Use pr_devel() in xics.c 2009-07-08 13:50:21 +10:00
xics.h powerpc/xics: Consolidate ipi message encode and decode 2008-10-13 16:24:16 +11:00