HomeFreeBSD

arm64: Initialize x18 for APs earlier during boot

Description

arm64: Initialize x18 for APs earlier during boot

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.

Reviewed by: kib, andrew
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D42533

(cherry picked from commit b9c0003f0fa39ead4bb3953b9118ae6f08e560f8)

Details

Provenance
markjAuthored on Nov 13 2023, 3:44 PM
Reviewer
kib
Differential Revision
D42533: arm64: Initialize x18 for APs earlier during boot
Parents
rG4025b5b527c8: libc: Purge unneeded cdefs.h
Branches
Unknown
Tags
Unknown