kernel_optimize_test/arch/powerpc/platforms
Paul Mackerras 53c656c413 powerpc/powernv: Handle irq_happened flag correctly in off-line loop
This fixes a bug where it is possible for an off-line CPU to fail to go
into a low-power state (nap/sleep/winkle), and to become unresponsive to
requests from the KVM subsystem to wake up and run a VCPU. What can
happen is that a maskable interrupt of some kind (external, decrementer,
hypervisor doorbell, or HMI) after we have called local_irq_disable() at
the beginning of pnv_smp_cpu_kill_self() and before interrupts are
hard-disabled inside power7_nap/sleep/winkle(). In this situation, the
pending event is marked in the irq_happened flag in the PACA. This
pending event prevents power7_nap/sleep/winkle from going to the
requested low-power state; instead they return immediately. We don't
deal with any of these pending event flags in the off-line loop in
pnv_smp_cpu_kill_self() because power7_nap et al. return 0 in this case,
so we will have srr1 == 0, and none of the processing to clear
interrupts or doorbells will be done.

Usually, the most obvious symptom of this is that a KVM guest will fail
with a console message saying "KVM: couldn't grab cpu N".

This fixes the problem by making sure we handle the irq_happened flags
properly. First, we hard-disable before the off-line loop. Once we have
hard-disabled, the irq_happened flags can't change underneath us. We
unconditionally clear the DEC and HMI flags: there is no processing of
timer interrupts while off-line, and the necessary HMI processing is all
done in lower-level code. We leave the EE and DBELL flags alone for the
first iteration of the loop, so that we won't fail to respond to a
split-core request that came in just before hard-disabling. Within the
loop, we handle external interrupts if the EE bit is set in irq_happened
as well as if the low-power state was interrupted by an external
interrupt. (We don't need to do the msgclr for a pending doorbell in
irq_happened, because doorbells are edge-triggered and don't remain
pending in hardware.) Then we clear both the EE and DBELL flags, and
once clear, they cannot be set again (until this CPU comes online again,
that is).

This also fixes the debug check to not be done when we just ran a KVM
guest or when the sleep didn't happen because of a pending event in
irq_happened.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-10-21 20:52:49 +11:00
..
8xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
40x
44x
52xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
82xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
83xx
85xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
86xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
512x genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
amigaone
cell genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
chrp genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
embedded6xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
maple
pasemi powerpc/MSI: Fix race condition in tearing down MSI interrupts 2015-09-10 17:27:08 +10:00
powermac
powernv powerpc/powernv: Handle irq_happened flag correctly in off-line loop 2015-10-21 20:52:49 +11:00
ps3 powerpc/ps3: Remove unused os_area_db_id_video_mode 2015-09-30 10:33:02 +10:00
pseries Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-18 08:11:42 -07:00
fsl_uli1575.c
Kconfig
Kconfig.cputype
Makefile