kernel-hacking-2024-linux-s.../arch/sh/kernel
Arnd Bergmann 30766f1105 sh: rework sync_file_range ABI
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>
2024-06-25 15:57:26 +02:00
..
cpu sh: sh7757: Add missing #include <asm/mmzone.h> 2024-05-02 12:01:31 +02:00
syscalls sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
vsyscall arch: use $(obj)/ instead of $(src)/ for preprocessed linker scripts 2024-05-02 20:14:16 +09:00
.gitignore
asm-offsets.c
crash_dump.c
debugtraps.S
disassemble.c
dma-coherent.c
dumpstack.c
dwarf.c sh: dwarf: Make dwarf_lookup_fde() static 2024-05-02 12:01:25 +02:00
entry-common.S
ftrace.c
head_32.S
hw_breakpoint.c
idle.c
io.c
io_trapped.c
iomap.c
ioport.c
irq.c
irq_32.c
kdebugfs.c
kgdb.c
kprobes.c sh: kprobes: Remove unneeded kprobe_opcode_t casts 2024-05-02 12:01:25 +02:00
machine_kexec.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
machvec.c
Makefile arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
module.c
nmi_debug.c
perf_callchain.c
perf_event.c
process.c
process_32.c
ptrace.c
ptrace_32.c
reboot.c sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC 2023-12-12 17:20:18 -08:00
relocate_kernel.S
return_address.c sh: return_address: Add missing #include <asm/ftrace.h> 2024-05-02 12:01:23 +02:00
setup.c sh, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
sh_bios.c
sh_ksyms_32.c
signal_32.c
smp.c sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING 2024-05-13 15:37:11 +02:00
stacktrace.c
swsusp.c
sys_sh.c
sys_sh32.c sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
syscalls_32.S
time.c
topology.c
traps.c sh: ftrace: Fix missing prototypes 2024-05-02 12:01:24 +02:00
traps_32.c sh: traps: Make is_dsp_inst() static 2024-05-02 12:01:31 +02:00
unwinder.c
vmcore_info.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
vmlinux.lds.S