WSL2-Linux-Kernel/arch/sh
Arnd Bergmann 79d2e629ec sh: rework sync_file_range ABI
commit 30766f1105d6d2459c3b9fe34a3e52b637a72950 upstream.

The unusual function calling conventions on SuperH ended up causing
sync_file_range to have the wrong argument order, with the 'flags'
argument getting sorted before 'nbytes' by the compiler.

In userspace, I found that musl, glibc, uclibc and strace all expect the
normal calling conventions with 'nbytes' last, so changing the kernel
to match them should make all of those work.

In order to be able to also fix libc implementations to work with existing
kernels, they need to be able to tell which ABI is used. An easy way
to do this is to add yet another system call using the sync_file_range2
ABI that works the same on all architectures.

Old user binaries can now work on new kernels, and new binaries can
try the new sync_file_range2() to work with new kernels or fall back
to the old sync_file_range() version if that doesn't exist.

Cc: stable@vger.kernel.org
Fixes: 75c92acdd5 ("sh: Wire up new syscalls.")
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-05 09:14:48 +02:00
..
boards sh: boards: Fix CEU buffer size passed to dma_declare_coherent_memory() 2023-09-19 12:23:00 +02:00
boot sh: Add missing FORCE prerequisites in Makefile 2021-09-19 10:13:42 +09:00
cchips treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
configs Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
drivers sh: dma: Fix DMA channel offset calculation 2023-07-23 13:47:30 +02:00
include sh/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:58:31 +02:00
kernel sh: rework sync_file_range ABI 2024-07-05 09:14:48 +02:00
lib Revert "sh: Handle calling csum_partial with misaligned data" 2024-06-16 13:39:23 +02:00
math-emu sh: math-emu: fix macro redefined warning 2023-05-17 11:50:23 +02:00
mm mm/memory_hotplug: remove nid parameter from arch_remove_memory() 2021-09-08 11:50:23 -07:00
tools sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00
Kbuild sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild 2021-05-26 23:11:47 +09:00
Kconfig sh/cpu: Switch to arch_cpu_finalize_init() 2023-08-08 19:58:31 +02:00
Kconfig.cpu docs: sh: convert register-banks.txt to ReST 2020-06-19 14:10:13 -06:00
Kconfig.debug sh: bios: Revive earlyprintk support 2023-11-20 11:08:23 +01:00
Makefile sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild 2021-05-26 23:11:47 +09:00