]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Initialize thread pointer before calling C functions
authorAlexandre Ghiti <alexandre.ghiti@canonical.com>
Mon, 6 Dec 2021 10:46:56 +0000 (11:46 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 2 Jun 2022 04:46:23 +0000 (21:46 -0700)
commit922808181c40faed9f56eb53bb8a2e3fd92fad4a
tree60dedb666a8c39534bb147af6edf058e60b8a17d
parent763e1a11f0c8c44d4bfd577153357094f1fc3ef3
riscv: Initialize thread pointer before calling C functions

Because of the stack canary feature that reads from the current task
structure the stack canary value, the thread pointer register "tp" must
be set before calling any C function from head.S: by chance, setup_vm
and all the functions that it calls does not seem to be part of the
functions where the canary check is done, but in the following commits,
some functions will.

Fixes: 4654da0badb2eda7 ("riscv: Add STACKPROTECTOR supported")
Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/head.S