freebsd-dev/sys/powerpc
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
..
aim sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
amigaone powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
booke sched: separate out schedinit_ap() 2021-11-03 15:54:59 -05:00
conf Restore PPS_SYNC in NOTES 2021-10-12 23:10:35 +03:00
cpufreq powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
fpu Create sys/reg.h for the common code previously in machine/reg.h 2021-08-30 12:50:53 +01:00
include powerpc64: fix OFWFB with Radix MMU 2021-10-14 10:39:52 -03:00
mambo Add CFI start/end proc directives to arm64, i386, and ppc 2020-12-05 00:33:28 +00:00
mikrotik powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00
mpc85xx Rename ofwpci.c to ofw_pcib.c 2021-05-20 11:22:25 +02:00
ofw bus_child_pnpinfo: fix two stragglers 2021-06-22 22:10:31 -06:00
powermac newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
powernv newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf 2021-06-22 20:52:06 -06:00
powerpc Convert vm_page_alloc() callers to use vm_page_alloc_noobj(). 2021-10-19 21:22:56 -04:00
ps3 cam: clear on-stack CCBs in last few drivers 2021-05-21 08:53:59 +01:00
pseries powerpc/pseries: Allow radix pmap in pseries for ISA 3.0 2021-08-11 19:07:04 -05:00
psim powerpc: clean up empty lines in .c and .h files 2020-09-01 21:20:08 +00:00