]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: sud_test: return correct emulated syscall value on RISC-V
authorClément Léger <cleger@rivosinc.com>
Wed, 6 Dec 2023 13:44:37 +0000 (14:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:48:48 +0000 (09:48 +0200)
commit51e5e52a59d0dd83e6b9e418dccd366c2a3861e5
tree036af3b39b2c9b69df1bea67f2606850aa42fbf3
parent25d79d845838551f5dbddd936f5558dfd69344c5
selftests: sud_test: return correct emulated syscall value on RISC-V

[ Upstream commit 17c67ed752d6a456602b3dbb25c5ae4d3de5deab ]

Currently, the sud_test expects the emulated syscall to return the
emulated syscall number. This assumption only works on architectures
were the syscall calling convention use the same register for syscall
number/syscall return value. This is not the case for RISC-V and thus
the return value must be also emulated using the provided ucontext.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20231206134438.473166-1-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/syscall_user_dispatch/sud_test.c