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)
Sat, Dec 14, 4:54 PM
Unknown Object (File)
Fri, Dec 13, 10:37 AM
Unknown Object (File)
Thu, Dec 12, 10:13 AM
Unknown Object (File)
Thu, Dec 12, 7:43 AM
Unknown Object (File)
Tue, Dec 10, 6:22 AM
Unknown Object (File)
Mon, Dec 9, 5:26 PM
Unknown Object (File)
Sun, Dec 8, 11:44 PM
Unknown Object (File)
Nov 25 2024, 10:56 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 60424
Build 57308: arc lint + arc unit

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.