linux_dsm_epyc7002/arch/powerpc/platforms
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
..
8xx powerpc/cpm: Remove some cruft code and defines 2009-05-19 00:47:19 -05:00
40x powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC 2009-08-31 09:15:51 -04:00
44x powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support. 2009-08-31 08:24:15 -04:00
52xx powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function 2009-06-17 00:30:22 -06:00
82xx powerpc/82xx: Add CPM USB Gadget support for MPC8272ADS boards 2009-08-25 09:44:06 -05:00
83xx powerpc/83xx: Add eSDHC support for MPC837xE-RDB/WLAN boards 2009-08-20 10:27:51 +10:00
85xx powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops 2009-09-11 11:27:57 +10:00
86xx powerpc: Remove swiotlb_pci_dma_ops 2009-08-28 14:24:09 +10:00
512x powerpc/5121: make clock debug output more readable 2009-06-17 01:24:10 -06:00
amigaone powerpc/amigaone: Convert amigaone_init() to a machine_device_initcall() 2009-08-20 10:12:21 +10:00
cell powerpc: use dma_map_ops struct 2009-08-28 14:24:10 +10:00
chrp powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock 2009-06-26 16:55:25 +10:00
embedded6xx Merge commit 'origin/master' into next 2009-03-24 13:38:30 +11:00
iseries powerpc: Remove use of a second scratch SPRG in STAB code 2009-08-20 10:12:28 +10:00
maple edac: cpc925 MC platform device setup 2009-06-18 13:03:57 -07:00
pasemi powerpc: ARRAY_SIZE changes in pasemi and powermac code 2009-08-20 10:29:23 +10:00
powermac powerpc: Fix some late PowerMac G5 with PCIe ATI graphics 2009-09-02 16:20:42 +10:00
prep powerpc/kconfig: Kill PPC_MULTIPLATFORM 2009-03-11 17:11:35 +11:00
ps3 powerpc: use dma_map_ops struct 2009-08-28 14:24:10 +10:00
pseries powerpc: Fix bug where perf_counters breaks oprofile 2009-09-11 11:27:58 +10:00
fsl_uli1575.c powerpc/85xx: Add P2020DS board support 2009-05-19 00:50:43 -05:00
Kconfig powerpc/virtex: Add support for Xilinx PCI host bridge 2009-06-06 10:14:22 -06:00
Kconfig.cputype powerpc: Remaining 64-bit Book3E support 2009-08-20 10:25:11 +10:00
Makefile powerpc: Add configurable -Werror for arch/powerpc 2009-06-16 14:15:45 +10:00