]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/smpboot: Split up native_cpu_up into separate phases and document them
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 28 Jan 2021 16:12:14 +0000 (16:12 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 14 Dec 2021 09:27:48 +0000 (09:27 +0000)
commit64dfc98afdd7d92dc0b2cc38aecefc402b50e109
treeb405be8aad86cacf6c98fc742cb60a38f8c04c4f
parentd21ced23df21d122493107bdb7bdc32d2798e8ac
x86/smpboot: Split up native_cpu_up into separate phases and document them

There are four logical parts to what native_cpu_up() does on the BSP (or
on the controlling CPU for a later hotplug).

First it actually wakes the AP by sending the INIT/SIPI/SIPI sequence.

Second, it waits for the AP to make it as far as wait_for_master_cpu()
which sets that CPU's bit in cpu_initialized_mask, then sets the bit in
cpu_callout_mask to let the AP proceed through cpu_init().

Then, it waits for the AP to finish cpu_init() and get as far as the
smp_callin() call, which sets that CPU's bit in cpu_callin_mask.

Finally, it does the TSC synchronization and waits for the AP to actually
mark itself online in cpu_online_mask.

This commit should have no behavioural change, but merely splits those
phases out into separate functions so that future commits can make them
happen in parallel for all APs. And adds some comments around them on
both the BSP and AP code paths.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kernel/smpboot.c