aha/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
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
eeh_sysfs.c
firmware.c
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
hvCall_inst.c
hvconsole.c
hvcserver.c
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
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
pci.c
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
pseries.h
ras.c
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
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