Skip to contentSkip to conversation

xen/x86: fix cpu hotplug

PATCH In review Juergen Gross 2 participants 3 messages Jul 5, 2017 – Jul 18, 2017

Subsystems (3)
lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

PATCH 1/1 xen/x86: fix cpu hotplug

Commit dc6416f1d711eb4c1726e845d653235dcaae12e1 ("xen/x86: Call cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()") introduced an error leading to a stack overflow of the idle task when a cpu was brought offline/online many times: by calling cpu_startup_entry() instead of returning at the end of xen_play_dead() do_idle() would be entered again and again.

Don't use cpu_startup_entry(), but cpuhp_online_idle() instead allowing to return from xen_play_dead().

---
For 4.11 the patch has to be backported.

---
 arch/x86/xen/smp_pv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/xen/smp_pv.c +2 -1
index aae32535f4ec..3e71246da5fe 100644
@@ -19,6 +19,7 @@
 #include <linux/irq_work.h>
 #include <linux/tick.h>
 #include <linux/nmi.h>
+#include <linux/cpuhotplug.h>
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
@@ -417,7 +418,7 @@ static void xen_pv_play_dead(void) /* used only with HOTPLUG_CPU */
 	 */
 	tick_nohz_idle_enter();
 
-	cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
+	cpuhp_online_idle(CPUHP_AP_ONLINE_IDLE);
 }
 
 #else /* !CONFIG_HOTPLUG_CPU */
Signature · 1 line
2.12.3
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Juergen Gross

Commit dc6416f1d711eb4c1726e845d653235dcaae12e1 ("xen/x86: Call cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()") introduced an error leading to a stack overflow of the idle task when a cpu was brought offline/online many times: by calling cpu_startup_entry() instead of returning at the end of xen_play_dead() do_idle() would be entered again and again.

Quoted 5 lines

Don't use cpu_startup_entry(), but cpuhp_online_idle() instead allowing to return from xen_play_dead().

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Juergen Gross
Quoted 7 lines · Juergen Gross

Commit dc6416f1d711eb4c1726e845d653235dcaae12e1 ("xen/x86: Call cpu_startup_entry(CPUHP_AP_ONLINE_IDLE) from xen_play_dead()") introduced an error leading to a stack overflow of the idle task when a cpu was brought offline/online many times: by calling cpu_startup_entry() instead of returning at the end of xen_play_dead() do_idle() would be entered again and again.

Quoted 5 lines

Don't use cpu_startup_entry(), but cpuhp_online_idle() instead allowing to return from xen_play_dead().