OpenCloudOS-Kernel/arch/sh
Arnd Bergmann 91878a2bc8 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:34:02 +02:00
..
boards sh: ecovec24: Rename missed backlight field from fbdev to dev 2024-01-31 16:18:48 -08:00
boot sh: Use generic GCC library routines 2023-04-25 09:16:47 +02:00
cchips sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ 2023-07-13 08:37:53 +02:00
configs treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
drivers sh: push-switch: Reorder cleanup operations to avoid use-after-free bug 2023-09-09 21:54:20 +02:00
include mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
kernel sh: rework sync_file_range ABI 2024-07-05 09:34:02 +02:00
lib Revert "sh: Handle calling csum_partial with misaligned data" 2024-06-12 11:11:48 +02:00
math-emu sh: math-emu: fix macro redefined warning 2023-03-23 10:00:03 +01:00
mm sh: mm: re-add lost __ref to ioremap_prot() to fix modpost warning 2023-09-19 13:21:32 -07:00
tools sh: Remove SH5-based Cayman platform 2020-08-14 22:05:06 -04:00
Kbuild sh: Move build rule for cchips/hd6446x/ to arch/sh/Kbuild 2023-07-05 18:55:18 +02:00
Kconfig - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig.cpu docs: move superh documentation under Documentation/arch/ 2023-03-30 13:00:35 -06:00
Kconfig.debug sh: bios: Revive earlyprintk support 2023-11-20 11:59:22 +01:00
Makefile sh: Remove compiler flag duplication 2023-07-05 18:55:25 +02:00