riscv: entry: Add noinstr to prevent instrumentation inserted
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 22 Feb 2023 03:30:17 +0000 (22:30 -0500)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 23 Mar 2023 15:46:59 +0000 (08:46 -0700)
commitd0db02c628793e389538c0e5c3f6491141ea6200
treea8de780ad28436a3e10357172aad59da7ee16b75
parent8574bf8d0ddd46f0bc393381563f59a6f4418a3e
riscv: entry: Add noinstr to prevent instrumentation inserted

Without noinstr the compiler is free to insert instrumentation (think
all the k*SAN, KCov, GCov, ftrace etc..) which can call code we're not
yet ready to run this early in the entry path, for instance it could
rely on RCU which isn't on yet, or expect lockdep state. (by peterz)

Link: https://lore.kernel.org/linux-riscv/YxcQ6NoPf3AH0EXe@hirez.programming.kicks-ass.net/
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20230222033021.983168-4-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/traps.c