android_kernel_xiaomi_sm8350/arch/powerpc/kernel
Livio Soares 449d846dbc [POWERPC] Fix performance monitor exception
To the issue: some point during 2.6.20 development, Paul Mackerras
introduced the "lazy IRQ  disabling" patch (very cool work,  BTW).
In that patch, the performance monitor unit exception was marked as
"maskable", in the sense that if interrupts were soft-disabled, that
exception could be ignored.  This broke my PowerPC profiling code.
The symptom that I see is that a varying number of interrupts
(from 0 to $n$, typically closer to 0) get delivered, when, in
reality, it should always be very close to $n$.

The issue stems from the way masking is being done.   Masking in
this fashion seems to  work well with the decrementer and external
interrupts, because they are raised again until "really"  handled.
For the PMU, however, this does not apply (at least on my Xserver
machine with a 970FX processor).  If the PMU exception is not handled,
it will _not_ be re-raised (at least on my machine).  The documentation
states that the PMXE bit in MMCR0 is set to 0 when the PMU exception
is raised.  However, software must re-set the bit to re-enable PMU
exceptions.  If the exception is ignored (as currently) not only is
that interrupt lost, but because software does not re-set PMXE, the
PMU registers are "frozen" forever.

[This patch means that performance monitor exceptions are taken and
handled even if irqs are off, as long as some other interrupt hasn't
come along and caused interrupts to be hard-disabled.  In this sense
the PMU exception becomes like an NMI.  The oprofile code for most
powerpc processors does nothing that is unsafe in an NMI context, but
the Cell oprofile code does a spin_lock_irqsave.  However, that turns
out to be OK because Cell doesn't actually use the performance
monitor exception; performance monitor interrupts come in as a
regular interrupt on Cell, so will be disabled when irqs are off.
 -- paulus.]

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-02-07 14:03:23 +11:00
..
vdso32
vdso64
align.c
asm-offsets.c [POWERPC] Fix manual assembly WARN_ON() in enter_rtas(). 2007-01-09 17:03:02 +11:00
audit.c
binfmt_elf32.c
btext.c
compat_audit.c
cpu_setup_6xx.S
cpu_setup_pa6t.S [POWERPC] pasemi: Idle loops 2007-02-07 14:03:22 +11:00
cpu_setup_ppc970.S
cputable.c [POWERPC] pasemi: Idle loops 2007-02-07 14:03:22 +11:00
crash_dump.c
crash.c [PATCH] Kexec / Kdump: Unify elf note code 2006-12-07 08:39:46 -08:00
dma_64.c
entry_32.S
entry_64.S [POWERPC] Fix manual assembly WARN_ON() in enter_rtas(). 2007-01-09 17:03:02 +11:00
firmware.c
fpu.S
head_4xx.S
head_8xx.S
head_32.S [POWERPC] Remove the broken Gemini support 2007-01-24 21:13:58 +11:00
head_44x.S
head_64.S [POWERPC] Fix performance monitor exception 2007-02-07 14:03:23 +11:00
head_booke.h
head_fsl_booke.S
ibmebus.c [POWERPC] Replace kmalloc+memset with kzalloc 2006-12-04 20:42:09 +11:00
idle_6xx.S
idle_power4.S
idle.c
init_task.c
io.c
iomap.c [POWERPC] Remove fastcall function attribute 2007-01-26 01:52:27 -06:00
iommu.c
irq.c [POWERPC] Add IRQ remapping hook 2007-01-24 21:13:59 +11:00
kprobes.c [PATCH] kprobes: enable booster on the preemptible kernel 2006-12-07 08:39:38 -08:00
l2cr_6xx.S
legacy_serial.c
lparcfg.c
lparmap.c
machine_kexec_32.c
machine_kexec_64.c
machine_kexec.c
Makefile [POWERPC] pasemi: Idle loops 2007-02-07 14:03:22 +11:00
misc_32.S
misc_64.S [POWERPC] pasemi: UART udbg support 2007-02-07 14:03:22 +11:00
misc.S
module_32.c [POWERPC] Add support for R_PPC_ADDR16_HI relocations 2007-01-24 21:13:58 +11:00
module_64.c [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00
nvram_64.c [PATCH] getting rid of all casts of k[cmz]alloc() calls 2006-12-13 09:05:58 -08:00
of_device.c [POWERPC] of_device_register: propagate device_create_file return code 2006-12-08 02:23:07 -06:00
of_platform.c [POWERPC] powerpc: add scanning of ebc bus to of_platform 2006-12-19 15:35:40 +01:00
paca.c
pci_32.c [POWERPC] Do not write virq back to PCI config space 2007-01-24 21:13:57 +11:00
pci_64.c [POWERPC] Do not write virq back to PCI config space 2007-01-24 21:13:57 +11:00
pci_dn.c
pmc.c [POWERPC] PA6T PMC support 2007-02-07 14:03:19 +11:00
ppc32.h
ppc_ksyms.c [POWERPC] Compile fixes for arch/powerpc dcr code 2007-02-07 14:03:23 +11:00
proc_ppc64.c [PATCH] struct path: convert powerpc 2006-12-08 08:28:48 -08:00
process.c
prom_init.c [POWERPC] Support ibm,dynamic-reconfiguration-memory nodes 2006-12-11 13:49:49 +11:00
prom_parse.c [POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges 2006-12-20 16:37:47 +11:00
prom.c [POWERPC] arch/ppc/kernel/prom.c of_node_(get|put) cleanup 2007-01-24 21:13:57 +11:00
ptrace32.c
ptrace-common.h
ptrace.c [POWERPC] Mask 32-bit system call arguments to 32 bits on PPC64 in audit code 2007-01-24 21:13:58 +11:00
rtas_flash.c [PATCH] struct path: convert powerpc 2006-12-08 08:28:48 -08:00
rtas_pci.c
rtas-proc.c
rtas-rtc.c
rtas.c [POWERPC] Add rtas_service_present() helper 2006-12-08 17:10:22 +11:00
semaphore.c
setup_32.c
setup_64.c
setup-common.c
setup.h
signal_32.c [POWERPC] Fix register save area alignment for swapcontext syscall 2006-12-20 16:37:49 +11:00
signal_64.c
smp-tbsync.c [POWERPC] Replace kmalloc+memset with kzalloc 2006-12-04 20:42:09 +11:00
smp.c [PATCH] Change cpu_up and co from __devinit to __cpuinit 2007-01-11 18:18:20 -08:00
swsusp_32.S
sys_ppc32.c
syscalls.c
sysfs.c [POWERPC] PA6T PMC support 2007-02-07 14:03:19 +11:00
systbl.S
tau_6xx.c
time.c
traps.c [POWERPC] Use is_init() instead of pid==1 2007-01-24 21:13:56 +11:00
udbg_16550.c [POWERPC] pasemi: UART udbg support 2007-02-07 14:03:22 +11:00
udbg.c [POWERPC] pasemi: UART udbg support 2007-02-07 14:03:22 +11:00
vdso.c [PATCH] slab: remove SLAB_KERNEL 2006-12-07 08:39:24 -08:00
vecemu.c
vector.S
vio.c [POWERPC] arch/powerpc/kernel/vio.c of_node_put cleanup 2007-01-24 21:13:57 +11:00
vmlinux.lds.S [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00