linux-stable/arch/riscv
Sami Tolvanen a9ad73295c
riscv: Fix syscall wrapper for >word-size arguments
The current syscall wrapper macros break 64-bit arguments on
rv32 because they only guarantee the first N input registers are
passed to syscalls that accept N arguments. According to the
calling convention, values twice the word size reside in register
pairs and as a result, syscall arguments don't always have a
direct register mapping on rv32.

Instead of using `__MAP(x,__SC_LONG,__VA_ARGS__)` to declare the
type of the `__se(_compat)_sys_*` functions on rv32, change the
function declarations to accept `ulong` arguments and alias them
to the actual syscall implementations, similarly to the existing
macros in include/linux/syscalls.h. This matches previous
behavior and ensures registers are passed to syscalls as-is, no
matter which argument types they expect.

Fixes: 08d0ce30e0 ("riscv: Implement syscall wrappers")
Reported-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20240311193143.2981310-2-samitolvanen@google.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2024-03-20 11:37:51 -07:00
..
boot riscv: dts: renesas: Add Andes PMU extension for r9a07g043f 2024-03-12 07:13:18 -07:00
configs Merge patch series "RISC-V: ACPI: Enable CPPC based cpufreq support" 2024-03-20 08:56:09 -07:00
crypto crypto: riscv - add vector crypto accelerated AES-CBC-CTS 2024-03-20 08:56:11 -07:00
errata riscv: errata: Rename defines for Andes 2024-03-12 07:13:12 -07:00
include riscv: Fix syscall wrapper for >word-size arguments 2024-03-20 11:37:51 -07:00
kernel riscv: Use kcalloc() instead of kzalloc() 2024-03-20 08:56:07 -07:00
kvm Generic: 2024-01-17 13:03:37 -08:00
lib Merge patch series "riscv: Use Kconfig to set unaligned access speed" 2024-03-15 10:17:14 -07:00
mm riscv: Only flush the mm icache when setting an exec pte 2024-03-20 08:56:08 -07:00
net bpf: Use arch_bpf_trampoline_size 2023-12-06 17:17:20 -08:00
purgatory riscv: Use SYM_*() assembly macros instead of deprecated ones 2023-11-06 09:42:47 -08:00
tools riscv: Check relocations at compile time 2023-04-19 07:46:32 -07:00
Kbuild RISC-V: hook new crypto subdir into build-system 2024-01-22 17:55:17 -08:00
Kconfig Merge patch series "riscv: Use Kconfig to set unaligned access speed" 2024-03-15 10:17:14 -07:00
Kconfig.debug riscv: Add tests for riscv module loading 2023-11-07 14:59:32 -08:00
Kconfig.errata RISC-V Patches for the 6.8 Merge Window, Part 4 2024-01-20 11:06:04 -08:00
Kconfig.socs SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
Makefile RISC-V: build: Allow LTO to be selected 2024-01-22 10:06:29 -08:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00