Searched hist:"058 cf7120c26d72cbcf802fc5ee82b6f1427b27c" (Results 1 – 1 of 1) sorted by relevance
| /optee_os/core/arch/riscv/kernel/ |
| H A D | entry.S | 058cf7120c26d72cbcf802fc5ee82b6f1427b27c Fri Nov 10 03:32:16 UTC 2023 Alvin Chang <alvinga@andestech.com> core: riscv: Do not restrict primary hart to hart ID 0 only
The ID of primary hart should not be restricted to zero. Thus, determining primary hart and secondart harts by zero hart ID is not feasible.
We refer to RISC-V linux kernel [1] to fix this issue, by adding a "hart_lottery" variable. The first hart who enters OP-TEE will win the lottery, atomically increment this variable, and be the primary hart. Other harts enter OP-TEE later won't win the lottery, so they execute the secondary boot sequence.
[1]: https://github.com/torvalds/linux/blob/v6.7/arch/riscv/kernel/head.S#L244
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Marouene Boubakri <marouene.boubakri@nxp.com>
|