kboot: Reserve secondary CPU stacks

The secondary CPU may potentially use the stack after leaving WFE.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
This commit is contained in:
Nick Chan 2024-08-25 15:40:29 +08:00 committed by Hector Martin
parent 5bb8f04bdf
commit 5b8cfd1e7c

View file

@ -408,6 +408,14 @@ static int dt_set_cpus(void)
cpu++;
node = next;
continue;
} else {
printf("FDT: Reserving stack for CPU %d 0x%lx\n", cpu, (uint64_t)secondary_stacks[cpu]);
fdt_add_mem_rsv(dt, (uint64_t)secondary_stacks[cpu], SECONDARY_STACK_SIZE);
if (has_el3()) {
printf("FDT: Reserving EL3 stack for CPU %d 0x%lx\n", cpu,
(uint64_t)secondary_stacks_el3[cpu]);
fdt_add_mem_rsv(dt, (uint64_t)secondary_stacks_el3[cpu], SECONDARY_STACK_SIZE);
}
}
u64 mpidr = smp_get_mpidr(cpu);