linux/arch/powerpc/platforms
Paul Mackerras 56548fc0e8 powerpc/powernv: Return to cpu offline loop when finished in KVM guest
When a secondary hardware thread has finished running a KVM guest, we
currently put that thread into nap mode using a nap instruction in
the KVM code.  This changes the code so that instead of doing a nap
instruction directly, we instead cause the call to power7_nap() that
put the thread into nap mode to return.  The reason for doing this is
to avoid having the KVM code having to know what low-power mode to
put the thread into.

In the case of a secondary thread used to run a KVM guest, the thread
will be offline from the point of view of the host kernel, and the
relevant power7_nap() call is the one in pnv_smp_cpu_disable().
In this case we don't want to clear pending IPIs in the offline loop
in that function, since that might cause us to miss the wakeup for
the next time the thread needs to run a guest.  To tell whether or
not to clear the interrupt, we use the SRR1 value returned from
power7_nap(), and check if it indicates an external interrupt.  We
arrange that the return from power7_nap() when we have finished running
a guest returns 0, so pending interrupts don't get flushed in that
case.

Note that it is important a secondary thread that has finished
executing in the guest, or that didn't have a guest to run, should
not return to power7_nap's caller while the kvm_hstate.hwthread_req
flag in the PACA is non-zero, because the return from power7_nap
will reenable the MMU, and the MMU might still be in guest context.
In this situation we spin at low priority in real mode waiting for
hwthread_req to become zero.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-12-08 13:16:31 +11:00
..
8xx powerpc/8xx: Remove Kconfig symbol FADS 2014-11-07 18:10:46 -06:00
40x powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
44x powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
52xx powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
82xx powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
83xx powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
85xx powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
86xx powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
512x powerpc: Remove bootmem allocator 2014-11-10 09:59:25 +11:00
amigaone lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
cell powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
chrp powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
embedded6xx powerpc/gamecube/wii: delete unneeded test before of_node_put 2014-11-10 09:59:35 +11:00
maple powerpc: Remove superfluous bootmem includes 2014-11-10 09:59:26 +11:00
pasemi powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
powermac powerpc: Remove more traces of bootmem 2014-11-19 21:41:51 +11:00
powernv powerpc/powernv: Return to cpu offline loop when finished in KVM guest 2014-12-08 13:16:31 +11:00
ps3 powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
pseries powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault 2014-12-05 16:26:15 +11:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00
Kconfig powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00
Kconfig.cputype Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux 2014-10-11 20:34:00 -04:00
Makefile powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00