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

From: Nick Desaulniers
Date: Fri Jan 05 2024 - 13:11:52 EST


On Wed, Jan 3, 2024 at 4:13 PM Tanzir Hasan <tanzirh@xxxxxxxxxx> wrote:
>
> This diff uses an open source tool include-what-you-use (IWYU) to modify
> the include list, changing indirect includes to direct includes. IWYU is
> implemented using the IWYUScripts github repository which is a tool that
> is currently undergoing development. These changes seek to improve build
> times.
>
> This change to entry/syscall_64.c resulted in a preprocessed size of
> entry/syscall_64.i from 64003 lines to 24509 lines (-62%) for the x86
> defconfig.
>
> Suggested-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Tanzir Hasan <tanzirh@xxxxxxxxxx>
> ---
> arch/x86/entry/syscall_64.c | 18 ++++++++++++++----

Generally question to the CC list. Does anyone know //why//
sys_call_table is defined as asmlinkage?

I don't see why `extern "C"` or __attribute__((regparm(0))) would be
necessary here, but maybe I'm missing something?

I don't think that's necessary to refer to //data// defined in C from
inline asm. Nothing in Documentation mentions this.

And honestly those two seem conflated IMO. UAPI headers make sense to
use extern C.

assembler defined functions called from C should have regparm set so C
callers know about the i386 calling convention change.

Those seem orthogonal to me; do we ever have cases where BOTH make sense?
--
Thanks,
~Nick Desaulniers