Searched hist:"0 cc8f3e4c3241ebbb0815162b65df351c4515c80" (Results 1 – 1 of 1) sorted by relevance
| /optee_os/core/arch/riscv/kernel/ |
| H A D | entry.S | 0cc8f3e4c3241ebbb0815162b65df351c4515c80 Thu May 11 14:35:18 UTC 2023 Alvin Chang <alvinga@andestech.com> core: riscv: kernel: Fix stack pointer initialization for each hart
The RISC-V privileged specification defines that at least one hart must have a hart ID of zero. Since at least one stack_tmp_stride is required for calculating the initial SP value for each hart, the formula should be address of stack_tmp plus (hartid+1) multiplied by stack_tmp_stride.
This commit fixes the formula for initializing SP of each hart, otherwise the stack underflow happens to hart 0.
Fixes: 93e54a63925f ("riscv: kernel: entry.S: provide entry script") Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
|