[PATCH] riscv: entry: Save a0 prior syscall_enter_from_user_mode()

Palmer Dabbelt palmer at rivosinc.com
Tue Apr 11 10:39:11 PDT 2023


On Mon, 03 Apr 2023 08:52:07 +0200, Björn Töpel wrote:
> The RISC-V calling convention passes the first argument, and the
> return value in the a0 register. For this reason, the a0 register
> needs some extra care; When handling syscalls, the a0 register is
> saved into regs->orig_a0, so a0 can be properly restored for,
> e.g. interrupted syscalls.
> 
> This functionality was broken with the introduction of the generic
> entry patches. Here, a0 was saved into orig_a0 after calling
> syscall_enter_from_user_mode(), which can change regs->a0 for some
> paths, incorrectly restoring a0.
> 
> [...]

Applied, thanks!

[1/1] riscv: entry: Save a0 prior syscall_enter_from_user_mode()
      https://git.kernel.org/palmer/c/9c2598d43510

Best regards,
-- 
Palmer Dabbelt <palmer at rivosinc.com>




More information about the linux-riscv mailing list