Skip to content

Commit 9474689

Browse files
committed
powerpc: Don't add __powerpc_ prefix to syscall entry points
When using syscall wrappers the __SYSCALL_DEFINEx() and related macros add a "__powerpc_" prefix to all syscall entry points. So for example sys_mmap becomes __powerpc_sys_mmap. This risks breaking workflows and tools that expect the old naming scheme. At a minimum setting a breakpoint on eg. sys_mmap with gdb no longer works. There seems to be no compelling reason to add the "__powerpc_" prefix, other than that it follows what some other arches do (x86, arm64, s390). But unlike other arches powerpc doesn't always enable syscall wrappers, so the syscall entry points can change name depending on CONFIG options. For those reasons drop the "__powerpc_" prefix, reverting to the existing naming. Doing so reveals two prototypes in signal.h that have the incorrect type when syscall wrappers are enabled. There are already prototypes for both functions in syscalls.h, so drop the ones from signal.h. Fixes: 7e92e01 ("powerpc: Provide syscall wrapper") Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b2e82e4 commit 9474689

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

arch/powerpc/include/asm/syscall_wrapper.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ struct pt_regs;
1616
,,regs->gpr[6],,regs->gpr[7],,regs->gpr[8])
1717

1818
#define __SYSCALL_DEFINEx(x, name, ...) \
19-
long __powerpc_sys##name(const struct pt_regs *regs); \
20-
ALLOW_ERROR_INJECTION(__powerpc_sys##name, ERRNO); \
19+
long sys##name(const struct pt_regs *regs); \
20+
ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
2121
static long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
2222
static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
23-
long __powerpc_sys##name(const struct pt_regs *regs) \
23+
long sys##name(const struct pt_regs *regs) \
2424
{ \
2525
return __se_sys##name(SC_POWERPC_REGS_TO_ARGS(x,__VA_ARGS__)); \
2626
} \
@@ -35,17 +35,15 @@ struct pt_regs;
3535

3636
#define SYSCALL_DEFINE0(sname) \
3737
SYSCALL_METADATA(_##sname, 0); \
38-
long __powerpc_sys_##sname(const struct pt_regs *__unused); \
39-
ALLOW_ERROR_INJECTION(__powerpc_sys_##sname, ERRNO); \
40-
long __powerpc_sys_##sname(const struct pt_regs *__unused)
38+
long sys_##sname(const struct pt_regs *__unused); \
39+
ALLOW_ERROR_INJECTION(sys_##sname, ERRNO); \
40+
long sys_##sname(const struct pt_regs *__unused)
4141

4242
#define COND_SYSCALL(name) \
43-
long __powerpc_sys_##name(const struct pt_regs *regs); \
44-
long __weak __powerpc_sys_##name(const struct pt_regs *regs) \
43+
long sys_##name(const struct pt_regs *regs); \
44+
long __weak sys_##name(const struct pt_regs *regs) \
4545
{ \
4646
return sys_ni_syscall(); \
4747
}
4848

49-
#define SYS_NI(name) SYSCALL_ALIAS(__powerpc_sys_##name, sys_ni_posix_timers);
50-
5149
#endif // __ASM_POWERPC_SYSCALL_WRAPPER_H

arch/powerpc/include/asm/syscalls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ long sys_ppc_fadvise64_64(int fd, int advice,
124124

125125
#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
126126
#define __SYSCALL(nr, entry) \
127-
long __powerpc_##entry(const struct pt_regs *regs);
127+
long entry(const struct pt_regs *regs);
128128

129129
#ifdef CONFIG_PPC64
130130
#include <asm/syscall_table_64.h>

arch/powerpc/kernel/signal.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ extern int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
196196

197197
#else /* CONFIG_PPC64 */
198198

199-
extern long sys_rt_sigreturn(void);
200-
extern long sys_sigreturn(void);
201-
202199
static inline int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
203200
struct task_struct *tsk)
204201
{

arch/powerpc/kernel/systbl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
#undef __SYSCALL
2222
#ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
23-
#define __SYSCALL(nr, entry) [nr] = __powerpc_##entry,
24-
#define __powerpc_sys_ni_syscall sys_ni_syscall
23+
#define __SYSCALL(nr, entry) [nr] = entry,
2524
#else
2625
/*
2726
* Coerce syscall handlers with arbitrary parameters to common type

0 commit comments

Comments
 (0)