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)
Dec 14 2023, 8:20 PM
Unknown Object (File)
Nov 12 2023, 9:27 PM
Unknown Object (File)
Nov 12 2023, 8:41 PM
Unknown Object (File)
Nov 12 2023, 5:24 PM
Unknown Object (File)
Oct 3 2023, 9:47 AM
Unknown Object (File)
Sep 6 2023, 12:07 AM
Unknown Object (File)
Sep 5 2023, 4:32 PM
Unknown Object (File)
Aug 16 2023, 7:57 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.