opnsense-src/sys/x86
Mark Johnston c31c881f7e Fix the test used to wait for AP startup on x86, arm64, riscv
On arm64, testing pc_curpcb != NULL is not correct since pc_curpcb is
set in pmap_switch() while the bootstrap stack is still in use.  As a
result, smp_after_idle_runnable() can free the boot stack prematurely.

Take a different approach: use smp_rendezvous() to wait for all APs to
acknowledge an interrupt.  Since APs must not enable interrupts until
they've entered the scheduler, i.e., switched off the boot stack, this
provides the right guarantee without depending as much on the
implementation of cpu_throw().  And, this approach applies to all
platforms, so convert x86 and riscv as well.

Reported by:	mmel
Tested by:	mmel
Reviewed by:	kib
Fixes:		8db2e8fd16 ("Remove the secondary_stacks array in arm64 and riscv kernels.")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f6b799a86b)
2022-06-29 10:13:44 -04:00
..
acpica x86: duplicate acpi_wakeup.c per i386 and amd64 2021-09-20 03:47:21 +03:00
bios smbios: Move smbios driver out from x86 machdep code 2022-03-03 08:20:07 -06:00
conf Use envvar rather than nonstandard hint. lines 2020-09-23 19:18:53 +00:00
cpufreq x86: Remove CTLFLAG_NEEDGIANT from sysctls. 2022-01-08 20:24:04 -05:00
include Remove dead code. 2022-06-17 22:34:10 +03:00
iommu Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2022-02-08 15:00:55 -05:00
isa i386: Fix the nodevice apic build 2022-04-11 09:43:27 -04:00
linux linux(4): Properly restore the thread signal mask after signal delivery on i386 2022-06-17 22:35:40 +03:00
pci pci: add missing PCI id of Coffee Lake GPU 2021-12-19 04:42:52 +02:00
x86 Fix the test used to wait for AP startup on x86, arm64, riscv 2022-06-29 10:13:44 -04:00
xen x86/xen: fallback when VCPUOP_send_nmi is not available 2022-04-12 10:05:47 +02:00