Read the arm64 midr register earlier

We use the midr_el1 register to decode which CPU type we are booting
from. Read it on the secondary CPUs before waiting for the boot CPU
to release us as it will need to use it before the release.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2021-08-11 16:01:25 +01:00
parent 69d8dc20be
commit 6b22840ed0

View File

@ -238,6 +238,7 @@ init_secondary(uint64_t cpu)
* We need this before signalling the CPU is ready to
* let the boot CPU use the results.
*/
pcpup->pc_midr = get_midr();
identify_cpu(cpu);
/* Ensure the stores in identify_cpu have completed */
@ -248,8 +249,6 @@ init_secondary(uint64_t cpu)
while (!atomic_load_int(&aps_ready))
__asm __volatile("wfe");
pcpup->pc_midr = get_midr();
/* Initialize curthread */
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
pcpup->pc_curthread = pcpup->pc_idlethread;