]> www.infradead.org Git - users/jedix/linux-maple.git/commit
riscv: uaccess: use 'asm goto' for put_user()
authorJisheng Zhang <jszhang@kernel.org>
Thu, 10 Apr 2025 07:05:25 +0000 (07:05 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 8 May 2025 17:01:00 +0000 (10:01 -0700)
commitcdf647e817143c9762c5bdf724ca2821a171f011
tree8096383227dbcf0074c1e1672f9bc5b6c62f533b
parent62135bf660b2c3887e22f33d3adbefedb4dc9c7a
riscv: uaccess: use 'asm goto' for put_user()

With 'asm goto' we don't need to test the error etc, the exception just
jumps to the error handling directly.

Because there are no output clobbers which could trigger gcc bugs [1]
the use of asm_goto_output() macro is not necessary here. Not using
asm_goto_output() is desirable as the generated output asm will be
cleaner.

Use of the volatile keyword is redundant as per gcc 14.2.0 manual section
6.48.2.7 Goto Labels:
> Also note that an asm goto statement is always implicitly considered
  volatile.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
[Cyril Bur: Rewritten commit message]
Signed-off-by: Cyril Bur <cyrilbur@tenstorrent.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20250410070526.3160847-5-cyrilbur@tenstorrent.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/uaccess.h