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

From: H. Peter Anvin
Date: Wed Dec 27 2023 - 21:19:08 EST


On December 27, 2023 4:26:14 PM PST, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>On Wed, Dec 27, 2023 at 03:50:33PM -0800, H. Peter Anvin wrote:
>> > /*
>> > * Only the low 32 bits of orig_ax are meaningful, so we return int.
>> > * This importantly ignores the high bits on 64-bit, so comparisons
>>
>> __visible is for LTO, no?
>
>If we need it in cases when array defined in entry/syscall_32.c and
>used in entry/common.c, I would respectfully suggest that whatever
>we need it for is misguided garbage. I don't think that LTO does
>need it, though. How is arch/x86/entry/{syscall_32,common}.c
>different from e.g. fs/{namespace,d_path}.c, where we have
>fs/namespace.c:100:__cacheline_aligned_in_smp DEFINE_SEQLOCK(mount_lock);
>and
>fs/d_path.c:166: read_seqbegin_or_lock(&mount_lock, &m_seq);
>respectively?

You're correct of course; __visible for LTO is for functions called from assembly *at the point of definition*, not declaration and certainly not as a type.