OSDN Git Service

powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers
authorRohan McLure <rmclure@linux.ibm.com>
Wed, 21 Sep 2022 06:55:55 +0000 (16:55 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Sep 2022 09:22:08 +0000 (19:22 +1000)
commitdec20c50df79cadaff17e964ef7f622491a52134
tree38be1e0568a6f82c8751405d186ae1f7b50424ec
parentac17defbeb4e8285c5b9752164b1d68b13bf3e3b
powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

Arch-specific implementations of syscall handlers are currently used
over generic implementations for the following reasons:

1. Semantics unique to powerpc
2. Compatibility syscalls require 'argument padding' to comply with
   64-bit argument convention in ELF32 abi.
3. Parameter types or order is different in other architectures.

These syscall handlers have been defined prior to this patch series
without invoking the SYSCALL_DEFINE or COMPAT_SYSCALL_DEFINE macros with
custom input and output types. We remove every such direct definition in
favour of the aforementioned macros.

Also update syscalls.tbl in order to refer to the symbol names generated
by each of these macros. Since ppc64_personality can be called by both
64 bit and 32 bit binaries through compatibility, we must generate both
both compat_sys_ and sys_ symbols for this handler.

As an aside:
A number of architectures including arm and powerpc agree on an
alternative argument order and numbering for most of these arch-specific
handlers. A future patch series may allow for asm/unistd.h to signal
through its defines that a generic implementation of these syscall
handlers with the correct calling convention be emitted, through the
__ARCH_WANT_COMPAT_SYS_... convention.

Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220921065605.1051927-16-rmclure@linux.ibm.com
arch/powerpc/include/asm/syscalls.h
arch/powerpc/kernel/sys_ppc32.c
arch/powerpc/kernel/syscalls.c
arch/powerpc/kernel/syscalls/syscall.tbl
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl