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
F106179244: D26765.diff
Thu, Dec 26, 5:01 PM
Unknown Object (File)
Thu, Dec 5, 8:18 AM
Unknown Object (File)
Nov 21 2024, 6:48 AM
Unknown Object (File)
Oct 4 2024, 4:10 PM
Unknown Object (File)
Oct 4 2024, 12:18 AM
Unknown Object (File)
Oct 3 2024, 3:12 PM
Unknown Object (File)
Oct 1 2024, 5:59 PM
Unknown Object (File)
Oct 1 2024, 5:15 AM
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.