Commit 07d36c9e authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Ingo Molnar

x86/vdso: Convert to hotplug state machine

Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Acked-by: default avatarAndy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160713153332.987560239@linutronix.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 6a4e2451
...@@ -294,15 +294,9 @@ static void vgetcpu_cpu_init(void *arg) ...@@ -294,15 +294,9 @@ static void vgetcpu_cpu_init(void *arg)
write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S);
} }
static int static int vgetcpu_online(unsigned int cpu)
vgetcpu_cpu_notifier(struct notifier_block *n, unsigned long action, void *arg)
{ {
long cpu = (long)arg; return smp_call_function_single(cpu, vgetcpu_cpu_init, NULL, 1);
if (action == CPU_ONLINE || action == CPU_ONLINE_FROZEN)
smp_call_function_single(cpu, vgetcpu_cpu_init, NULL, 1);
return NOTIFY_DONE;
} }
static int __init init_vdso(void) static int __init init_vdso(void)
...@@ -313,15 +307,9 @@ static int __init init_vdso(void) ...@@ -313,15 +307,9 @@ static int __init init_vdso(void)
init_vdso_image(&vdso_image_x32); init_vdso_image(&vdso_image_x32);
#endif #endif
cpu_notifier_register_begin();
on_each_cpu(vgetcpu_cpu_init, NULL, 1);
/* notifier priority > KVM */ /* notifier priority > KVM */
__hotcpu_notifier(vgetcpu_cpu_notifier, 30); return cpuhp_setup_state(CPUHP_AP_X86_VDSO_VMA_ONLINE,
"AP_X86_VDSO_VMA_ONLINE", vgetcpu_online, NULL);
cpu_notifier_register_done();
return 0;
} }
subsys_initcall(init_vdso); subsys_initcall(init_vdso);
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
...@@ -14,6 +14,7 @@ enum cpuhp_state { ...@@ -14,6 +14,7 @@ enum cpuhp_state {
CPUHP_TEARDOWN_CPU, CPUHP_TEARDOWN_CPU,
CPUHP_AP_ONLINE_IDLE, CPUHP_AP_ONLINE_IDLE,
CPUHP_AP_SMPBOOT_THREADS, CPUHP_AP_SMPBOOT_THREADS,
CPUHP_AP_X86_VDSO_VMA_ONLINE,
CPUHP_AP_NOTIFY_ONLINE, CPUHP_AP_NOTIFY_ONLINE,
CPUHP_AP_ONLINE_DYN, CPUHP_AP_ONLINE_DYN,
CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30, CPUHP_AP_ONLINE_DYN_END = CPUHP_AP_ONLINE_DYN + 30,
......
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