Page MenuHomeFreeBSD

arm64: Initialize x18 for APs earlier during boot
ClosedPublic

Authored by markj on Nov 9 2023, 7:14 PM.
Tags
None
Referenced Files
F108458985: D42533.id129961.diff
Sat, Jan 25, 1:11 AM
F108458506: D42533.id130015.diff
Sat, Jan 25, 1:01 AM
F108457591: D42533.id129907.diff
Sat, Jan 25, 12:42 AM
Unknown Object (File)
Fri, Jan 17, 12:40 PM
Unknown Object (File)
Fri, Jan 10, 7:39 AM
Unknown Object (File)
Tue, Dec 31, 2:10 AM
Unknown Object (File)
Dec 2 2024, 4:02 PM
Unknown Object (File)
Nov 30 2024, 12:37 PM
Subscribers

Details

Summary

When KMSAN is configured, the instrumentation inserts calls to
__msan_get_context_state() into all function prologues. The
implementation dereferences curthread and thus assumes that x18 points
to the PCPU area. This applies in particular to init_secondary(), which
currently is responsible for initializing x18 for APs.

Move initialization into locore to avoid this problem. No functional
change intended.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.

Diff Detail

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

Event Timeline

markj requested review of this revision.Nov 9 2023, 7:14 PM
This revision is now accepted and ready to land.Nov 9 2023, 11:27 PM
sys/arm64/arm64/locore.S
254–255

We can remove a pc-relative load & replace it with what is essentially an add. I have a local patch to clean up other places we use ldr, xn, =foo ldr xn, [xn].

markj marked an inline comment as done.

Apply Andy's suggestion

This revision now requires review to proceed.Nov 11 2023, 5:00 PM
This revision is now accepted and ready to land.Nov 12 2023, 3:57 PM