Skip to content

Commit

Permalink
kboot: Reserve secondary CPU stacks
Browse files Browse the repository at this point in the history
The secondary CPU may potentially use the stack after leaving WFE.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
  • Loading branch information
asdfugil committed Sep 26, 2024
1 parent fcffa87 commit 8d11336
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/kboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d11336

Please sign in to comment.