Skip to content

Commit 92ae583

Browse files
committed
aarch64: smp: reorder barriers before enabling MMU
1 parent ff42fea commit 92ae583

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

kernel/arch/aarch64/smp.c

+11-3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ void smp_bootstrap(void) {
9292
/* Set up TTBR0 with our temporary directory */
9393
"ldr x0, aarch64_ttbr0\n"
9494
"msr TTBR0_EL1, x0\n"
95+
"dsb ishst\n"
96+
"tlbi vmalle1is\n"
97+
"dsb ish\n"
98+
"isb\n"
9599
/* Load VBAR from first core */
96100
"ldr x0, aarch64_vbar\n"
97101
"msr VBAR_EL1, x0\n"
@@ -105,9 +109,6 @@ void smp_bootstrap(void) {
105109
"ldr x0, aarch64_sctlr\n"
106110
"ldr x1, aarch64_jmp_target\n"
107111
"msr SCTLR_EL1, x0\n"
108-
"dsb ishst\n"
109-
"tlbi vmalle1is\n"
110-
"dsb ish\n"
111112
"isb\n"
112113
/* Restore core ID as argument */
113114
"mov x0, x3\n"
@@ -188,5 +189,12 @@ void aarch64_smp_start(void) {
188189
aarch64_ttbr0 = mmu_map_to_physical(NULL, (uintptr_t)&startup_ttbr0[0]);
189190
aarch64_ttbr1 = mmu_map_to_physical(NULL, (uintptr_t)mmu_get_kernel_directory());
190191

192+
asm volatile (
193+
"dsb ishst\n"
194+
"tlbi vmalle1is\n"
195+
"dsb ish\n"
196+
"isb\n"
197+
);
198+
191199
dtb_callback_direct_children(cpus, start_cpu);
192200
}

0 commit comments

Comments
 (0)