opnsense-src/sys/arm64
Kyle Evans 589aed00e3 sched: separate out schedinit_ap()
schedinit_ap() sets up an AP for a later call to sched_throw(NULL).

Currently, ULE sets up some pcpu bits and fixes the idlethread lock with
a call to sched_throw(NULL); this results in a window where curthread is
setup in platforms' init_secondary(), but it has the wrong td_lock.
Typical platform AP startup procedure looks something like:

- Setup curthread
- ... other stuff, including cpu_initclocks_ap()
- Signal smp_started
- sched_throw(NULL) to enter the scheduler

cpu_initclocks_ap() may have callouts to process (e.g., nvme) and
attempt to sched_add() for this AP, but this attempt fails because
of the noted violated assumption leading to locking heartburn in
sched_setpreempt().

Interrupts are still disabled until cpu_throw() so we're not really at
risk of being preempted -- just let the scheduler in on it a little
earlier as part of setting up curthread.

Reviewed by:	alfredo, kib, markj
Triage help from:	andrew, markj
Smoke-tested by:	alfredo (ppc), kevans (arm64, x86), mhorne (arm)
Differential Revision:	https://reviews.freebsd.org/D32797
2021-11-03 15:54:59 -05:00
..
acpica Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
arm64 sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
broadcom genet: pullup minimum header amount for IPv4 2021-06-26 11:04:02 -05:00
cavium Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights 2021-08-08 10:42:24 -04:00
conf Enable PPS_SYNC on amd64, arm64 and armv7 2021-10-10 22:34:40 +03:00
coresight arm64: clean up empty lines in .c and .h files 2020-09-01 21:18:06 +00:00
freescale/imx Add the clock for the imx8 thermal monitoring unit. 2021-09-28 11:51:57 -06:00
include Allocate arm64 per-CPU data in the correct domain 2021-10-11 10:36:50 +01:00
intel Add support for Intel Stratix 10 platform. 2019-09-13 16:50:57 +00:00
iommu Use the vm_radix_init() helper when initializing pmaps 2021-10-19 21:22:56 -04:00
linux linux: Constify bsd_to_linux_regset() 2021-10-23 08:33:58 +01:00
nvidia/tegra210 arm64: Directly use #include <dt-binding/...> 2021-01-15 20:07:19 +01:00
qoriq NXP: Add ls1028a SPI clock driver 2021-10-29 09:52:20 +02:00
qualcomm Enable Qualcomm Debug Subsystem (QDSS) block on MSM8916 SoC. 2018-04-10 12:53:48 +00:00
rockchip arm: rockchip: rk3288: Use the macros that already exists in rk_cru.h 2021-09-15 20:10:42 +02:00