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.