On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > 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 <rmcl...@linux.ibm.com>
Looks good Reviewed-by: Nicholas Piggin <npig...@gmail.com> > --- > V1 -> V2: All syscall handlers wrapped by this macro. > V2 -> V3: Move creation of do_ppc64_personality helper to prior patch. > V3 -> V4: Fix parenthesis alignment. Don't emit sys_*** symbols. > V4 -> V5: Use 'aside' in the asm-generic rant in commit message. > --- > arch/powerpc/include/asm/syscalls.h | 10 ++--- > arch/powerpc/kernel/sys_ppc32.c | 38 +++++++++++------- > arch/powerpc/kernel/syscalls.c | 17 ++++++-- > arch/powerpc/kernel/syscalls/syscall.tbl | 22 +++++----- > .../arch/powerpc/entry/syscalls/syscall.tbl | 22 +++++----- > 5 files changed, 64 insertions(+), 45 deletions(-) >