riscv: vector: Support calling schedule() for preemptible Vector
authorAndy Chiu <andy.chiu@sifive.com>
Mon, 7 Apr 2025 18:08:31 +0000 (02:08 +0800)
committerPalmer Dabbelt <palmer@dabbelt.com>
Thu, 5 Jun 2025 18:09:27 +0000 (11:09 -0700)
commitd1049fc0de81bca3abbb35e8d4b8794170498b78
treee02e3e470c90a1b785db85bcbc08669acb21bcfe
parent5aa4ef95588456df5a5563dd23892827f97fb14f
riscv: vector: Support calling schedule() for preemptible Vector

Each function entry implies a call to ftrace infrastructure. And it may
call into schedule in some cases. So, it is possible for preemptible
kernel-mode Vector to implicitly call into schedule. Since all V-regs
are caller-saved, it is possible to drop all V context when a thread
voluntarily call schedule(). Besides, we currently don't pass argument
through vector register, so we don't have to save/restore V-regs in
ftrace trampoline.

Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Link: https://lore.kernel.org/r/20250407180838.42877-7-andybnac@gmail.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
arch/riscv/include/asm/processor.h
arch/riscv/include/asm/vector.h