Re: [PATCH 1/8] selftests: livepatch: test-syscall: Check for ARCH_HAS_SYSCALL_WRAPPER

Miroslav Benes
2026-03-20T10:45:08Z

> > So I would perhaps prefer to stay with the logic that defines
> > FN_PREFIX
> > per architecture and has also #else branch for the rest. And more
> > comments
> > never hurt.
>
> Agreed.

Hm, so I thought about a bit more and I very likely misunderstood the
motivation behind the patch. I will speculate and correct me if I am
wrong, please. The idea behind the whole patch set is to make the
selftests run on older kernels which I think is something we should
support. The issue is that old kernels (like mentioned 4.12) do not have
syscall wrappers at all. getpid() syscall is just plain old sys_getpid
there and not the current __x64_sys_getpid on x86. The patch fixes it
by checking CONFIG_ARCH_HAS_SYSCALL_WRAPPER and defining FN_PREFIX
accordingly.

So, if this is correct, I think it should be done differently. We should
have something like syscall_wrapper.h which would define FN_PREFIX for
the supported architectures and different kernel versions since the
wrappers may have changed a couple of times during the history. In that
case there could then be an #else branch which might just error out with
the message to add proper syscall wrapper naming.

The changelog then should explain it because it is not in fact tight to
powerpc.

What do you think? Am I off again?

Miroslav