]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/smpboot: Reference count on smpboot_setup_warm_reset_vector()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 23 Feb 2023 19:11:32 +0000 (19:11 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 11 Mar 2023 10:09:00 +0000 (10:09 +0000)
commitf12d57fe4fea4ed320a014a50b6a73c665d3773a
tree6f1c10e1a4cbecb49be49758fabf7c84032e0839
parent1eae436c3bcb1661a913da792d8d6e7026cfc95e
x86/smpboot: Reference count on smpboot_setup_warm_reset_vector()

When bringing up a secondary CPU from do_boot_cpu(), the warm reset flag
is set in CMOS and the starting IP for the trampoline written inside the
BDA at 0x467. Once the CPU is running, the CMOS flag is unset and the
value in the BDA cleared.

To allow for parallel bringup of CPUs, add a reference count to track the
number of CPUs currently bring brought up, and clear the state only when
the count reaches zero.

Since the RTC spinlock is required to write to the CMOS, it can be used
for mutual exclusion on the refcount too.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Usama Arif <usama.arif@bytedance.com>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Kim Phillips <kim.phillips@amd.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
arch/x86/kernel/smpboot.c