Commit 8dbce53c authored by Vaidyanathan Srinivasan's avatar Vaidyanathan Srinivasan Committed by Benjamin Herrenschmidt

powerpc: Reset kernel stack on cpu online from cede state

Cpu hotplug (offline) without dlpar operation will place cpu
in cede state and the extended_cede_processor() function will
return when resumed.

Kernel stack pointer needs to be reset before
start_secondary() is called to continue the online operation.

Added new function start_secondary_resume() to do the above
steps.
Signed-off-by: default avatarVaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent de0b632b
...@@ -617,6 +617,17 @@ _GLOBAL(start_secondary_prolog) ...@@ -617,6 +617,17 @@ _GLOBAL(start_secondary_prolog)
std r3,0(r1) /* Zero the stack frame pointer */ std r3,0(r1) /* Zero the stack frame pointer */
bl .start_secondary bl .start_secondary
b . b .
/*
* Reset stack pointer and call start_secondary
* to continue with online operation when woken up
* from cede in cpu offline.
*/
_GLOBAL(start_secondary_resume)
ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */
li r3,0
std r3,0(r1) /* Zero the stack frame pointer */
bl .start_secondary
b .
#endif #endif
/* /*
......
...@@ -146,12 +146,11 @@ static void pseries_mach_cpu_die(void) ...@@ -146,12 +146,11 @@ static void pseries_mach_cpu_die(void)
unregister_slb_shadow(hwcpu, __pa(get_slb_shadow())); unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
/* /*
* NOTE: Calling start_secondary() here for now to * Call to start_secondary_resume() will not return.
* start new context. * Kernel stack will be reset and start_secondary()
* However, need to do it cleanly by resetting the * will be called to continue the online operation.
* stack pointer.
*/ */
start_secondary(); start_secondary_resume();
} else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) { } else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
......
...@@ -35,4 +35,5 @@ static inline void set_default_offline_state(int cpu) ...@@ -35,4 +35,5 @@ static inline void set_default_offline_state(int cpu)
extern enum cpu_state_vals get_preferred_offline_state(int cpu); extern enum cpu_state_vals get_preferred_offline_state(int cpu);
extern int start_secondary(void); extern int start_secondary(void);
extern void start_secondary_resume(void);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment