提交 375f561a 编写于 作者: P Paul Mackerras 提交者: Benjamin Herrenschmidt

powerpc/powernv: Always go into nap mode when CPU is offline

The CPU hotplug code for the powernv platform currently only puts
offline CPUs into nap mode if the powersave_nap variable is set.
However, HV-style KVM on this platform requires secondary CPU threads
to be offline and in nap mode.  Since we know nap mode works just
fine on all POWER7 machines, and the only machines that support the
powernv platform are POWER7 machines, this changes the code to
always put offline CPUs into nap mode, regardless of powersave_nap.
Powersave_nap still controls whether or not CPUs go into nap mode
when idle, as before.
Signed-off-by: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 dabe859e
...@@ -386,6 +386,7 @@ extern unsigned long cpuidle_disable; ...@@ -386,6 +386,7 @@ extern unsigned long cpuidle_disable;
enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
extern int powersave_nap; /* set if nap mode can be used in idle loop */ extern int powersave_nap; /* set if nap mode can be used in idle loop */
extern void power7_nap(void);
#ifdef CONFIG_PSERIES_IDLE #ifdef CONFIG_PSERIES_IDLE
extern void update_smt_snooze_delay(int snooze); extern void update_smt_snooze_delay(int snooze);
......
...@@ -28,7 +28,9 @@ _GLOBAL(power7_idle) ...@@ -28,7 +28,9 @@ _GLOBAL(power7_idle)
lwz r4,ADDROFF(powersave_nap)(r3) lwz r4,ADDROFF(powersave_nap)(r3)
cmpwi 0,r4,0 cmpwi 0,r4,0
beqlr beqlr
/* fall through */
_GLOBAL(power7_nap)
/* NAP is a state loss, we create a regs frame on the /* NAP is a state loss, we create a regs frame on the
* stack, fill it up with the state we care about and * stack, fill it up with the state we care about and
* stick a pointer to it in PACAR1. We really only * stick a pointer to it in PACAR1. We really only
......
...@@ -106,14 +106,6 @@ static void pnv_smp_cpu_kill_self(void) ...@@ -106,14 +106,6 @@ static void pnv_smp_cpu_kill_self(void)
{ {
unsigned int cpu; unsigned int cpu;
/* If powersave_nap is enabled, use NAP mode, else just
* spin aimlessly
*/
if (!powersave_nap) {
generic_mach_cpu_die();
return;
}
/* Standard hot unplug procedure */ /* Standard hot unplug procedure */
local_irq_disable(); local_irq_disable();
idle_task_exit(); idle_task_exit();
...@@ -128,7 +120,7 @@ static void pnv_smp_cpu_kill_self(void) ...@@ -128,7 +120,7 @@ static void pnv_smp_cpu_kill_self(void)
*/ */
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1);
while (!generic_check_cpu_restart(cpu)) { while (!generic_check_cpu_restart(cpu)) {
power7_idle(); power7_nap();
if (!generic_check_cpu_restart(cpu)) { if (!generic_check_cpu_restart(cpu)) {
DBG("CPU%d Unexpected exit while offline !\n", cpu); DBG("CPU%d Unexpected exit while offline !\n", cpu);
/* We may be getting an IPI, so we re-enable /* We may be getting an IPI, so we re-enable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册