Page MenuHomeFreeBSD

Order SI_SUB_SMP before intrhooks when !EARLY_AP_STARTUP
AbandonedPublic

Authored by scottph on Oct 13 2020, 7:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 19, 4:18 PM
Unknown Object (File)
Sun, Apr 19, 4:18 PM
Unknown Object (File)
Thu, Apr 16, 11:59 AM
Unknown Object (File)
Sat, Apr 11, 9:28 PM
Unknown Object (File)
Wed, Apr 8, 2:45 AM
Unknown Object (File)
Mon, Apr 6, 9:40 PM
Unknown Object (File)
Mon, Apr 6, 3:54 AM
Unknown Object (File)
Sat, Apr 4, 4:06 PM
Subscribers

Details

Reviewers
jhb
andrew
Summary

Interrupts needed for config_intrhook might target a cpu that
isn't the boot cpu, so order AP startup earlier.

Sponsored by: Ampere Computing

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This works for my case, but I'm not sure if this will be a problem for other platforms, or maybe for downstream codebases?

Hmmm, that's an interesting idea. I don't know if this will work on other architectures off the top of my head. You can still try x86 without EARLY_AP_STARTUP in theory. @mhorne can perhaps try this on RISC-V?

In D26765#596859, @jhb wrote:

Hmmm, that's an interesting idea. I don't know if this will work on other architectures off the top of my head. You can still try x86 without EARLY_AP_STARTUP in theory. @mhorne can perhaps try this on RISC-V?

This boots okay on RISC-V, where I have tested EARLY_AP_STARTUP in the past. It seems like most SYSINITs in this range should be safe to be moved after SI_SUB_SMP, but a quick search for EARLY_AP_STARTUP shows a couple cases that should be adjusted:
sys/dev/hyperv/vmbus/vmbus.c - registers an intrhook conditional on !EARLY_AP_STARTUP
sys/dev/hwpmc/hwpmc_mod.c - registers SYSINIT to SI_SUB_SYSCALLS conditional on !EARLY_AP_STARTUP

@scottph I'd suggest searching through such cases yourself, since I only did so quickly.

D28340's approach of letting all CPUs get targeted by an ITS removes the need for moving around SI_SUB_SMP.