Re: [PATCH] x86/syscalls: shrink entry/syscall_32.i via IWYU

From: Nick Desaulniers
Date: Wed Jan 03 2024 - 11:51:22 EST


On Wed, Dec 27, 2023 at 4:45 PM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Dec 27, 2023 at 11:34:44PM +0000, Al Viro wrote:
>
> > That's _it_. The same goes for syscall_64.c and syscall_x32.c.
> > Oh, and lose the __visible/asmlinkage junk in there - none of that
> > stuff is used from asm these days. See the patch below -
> > Untested But Should Work(tm):
>
> Unfortunately, there's this in kernel/trace/trace_syscalls.c:
>
> unsigned long __init __weak arch_syscall_addr(int nr)
> {
> return (unsigned long)sys_call_table[nr];
> }
>
> How is that supposed to work for anything biarch? Including
> amd64 with CONFIG_COMPAT enabled?

commit f431b634f24d ("tracing/syscalls: Allow archs to ignore tracing
compat syscalls")

added a comment block about ARCH_TRACE_IGNORE_COMPAT_SYSCALLS, which
is defined for x86 in arch/x86/include/asm/ftrace.h.

The implementation of arch_syscall_addr for mips is quite complex;
dependent on quite a few different configs.

--
Thanks,
~Nick Desaulniers