Page MenuHomeFreeBSD

locore.S: stash boot arguments in saved registers
ClosedPublic

Authored by mhorne on Nov 5 2024, 8:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 29, 10:58 PM
Unknown Object (File)
Wed, Jul 23, 1:58 AM
Unknown Object (File)
Thu, Jul 17, 8:11 PM
Unknown Object (File)
Jul 6 2025, 9:06 PM
Unknown Object (File)
Jul 5 2025, 7:41 AM
Unknown Object (File)
Jun 30 2025, 8:33 PM
Unknown Object (File)
Jun 29 2025, 7:08 AM
Unknown Object (File)
Jun 28 2025, 3:07 PM
Subscribers

Details

Summary

Switch the boot argument registers to the unused s3 and s4. This ensures
the values will not be clobbered by SBI or function calls; they are
consumed late in the assembly routine.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

As with D47458, C code should not be run prior to enabling translation so we're running at the right address, so IMO this patch is a sign of going down the wrong road. Yes, Linux does horrendously fragile things like this, but that doesn't mean we should do the same.

Reduce the change, just switch to using s3/s4 registers, still needed to
preserve the values across SBI calls.

mhorne retitled this revision from locore.S: prepare for C function calls earlier to locore.S: stash boot arguments in saved registers.Nov 6 2024, 3:52 PM
mhorne edited the summary of this revision. (Show Details)
This revision was not accepted when it landed; it landed in state Needs Review.Nov 25 2024, 9:09 PM
This revision was automatically updated to reflect the committed changes.