From: Petr Mladek <pmladek@suse.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Jiri Kosina <jikos@kernel.org>,
Joe Lawrence <joe.lawrence@redhat.com>,
Shuah Khan <shuah@kernel.org>,
live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/6] selftests: livepatch: Check for ARCH_HAS_SYSCALL_WRAPPER config
Date: Fri, 17 Apr 2026 17:11:24 +0200 [thread overview]
Message-ID: <aeJNnFqLEdMgnHKh@pathway.suse.cz> (raw)
In-Reply-To: <alpine.LSU.2.21.2604151154330.1967@pobox.suse.cz>
On Wed 2026-04-15 11:58:50, Miroslav Benes wrote:
> On Mon, 13 Apr 2026, Marcos Paulo de Souza wrote:
>
> > Older kernels that lack CONFIG_ARCH_HAS_SYSCALL_WRAPPER config don't
> > have any prefixes for their syscalls. The same applies to current
> > powerpc and loongarch, covering all currently supported architectures
> > that support livepatch.
> >
> > The other supported architectures have specific prefixes, so error out
> > when a new architecture adds livepatch support with wrappes but didn't
> > update the test to include it.
> >
> > --- a/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
> > +++ b/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
> > @@ -12,15 +12,26 @@
> > #include <linux/slab.h>
> > #include <linux/livepatch.h>
> >
> > -#if defined(__x86_64__)
> > +/*
> > + * Before CONFIG_ARCH_HAS_SYSCALL_WRAPPER was introduced there were no
> > + * prefixes for system calls.
> > + * Both ppc and loongarch does not set prefixes for their system calls either.
> > + */
> > +#if !defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER) || defined(__powerpc__) || \
> > + defined(__loongarch__)
> > +#define FN_PREFIX
> > +#elif defined(__x86_64__)
> > #define FN_PREFIX __x64_
> > #elif defined(__s390x__)
> > #define FN_PREFIX __s390x_
> > #elif defined(__aarch64__)
> > #define FN_PREFIX __arm64_
> > -#else
> > -/* powerpc does not select ARCH_HAS_SYSCALL_WRAPPER */
> > +#elif defined(__powerpc__)
> > +#define FN_PREFIX
> > +#elif defined(__loongarch__)
> > #define FN_PREFIX
> > +#else
> > +#error "Missing syscall wrapper for the given architecture."
> > #endif
>
> I know that Sashiko commented on that already but even with that I wonder
> if it was cleaner to structure it differently...
>
> #if defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER)
> #if define(__x86_64__)
> ...
> #elif define(__powerpc__)
> #define FN_PREFIX
> #else
> #error
> #endif
> #elif
> #define FN_PREFIX
> #endif
Yeah, this looks better.
Best Regards,
Petr
next prev parent reply other threads:[~2026-04-17 15:11 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 17:26 [PATCH v2 0/6] kselftests: livepatch: Adapt tests to be executed on 4.12 kernels Marcos Paulo de Souza
2026-04-13 17:26 ` [PATCH v2 1/6] selftests: livepatch: Check for ARCH_HAS_SYSCALL_WRAPPER config Marcos Paulo de Souza
2026-04-15 9:58 ` Miroslav Benes
2026-04-17 15:11 ` Petr Mladek [this message]
2026-04-17 18:10 ` Joe Lawrence
2026-04-17 18:14 ` Joe Lawrence
2026-04-13 17:26 ` [PATCH v2 2/6] selftests: livepatch: Replace true/false module parameter by y/n Marcos Paulo de Souza
2026-04-13 17:26 ` [PATCH v2 3/6] selftests: livepatch: Introduce does_sysfs_exists function Marcos Paulo de Souza
2026-04-17 18:15 ` Joe Lawrence
2026-04-17 18:18 ` Joe Lawrence
2026-04-13 17:26 ` [PATCH v2 4/6] selftests: livepatch: Check if patched sysfs attribute exists Marcos Paulo de Souza
2026-04-17 15:21 ` Petr Mladek
2026-04-13 17:26 ` [PATCH v2 5/6] selftests: livepatch: Check if replace " Marcos Paulo de Souza
2026-04-13 17:26 ` [PATCH v2 6/6] selftests: livepatch: Check if stack_order " Marcos Paulo de Souza
2026-04-14 12:12 ` [PATCH v2 0/6] kselftests: livepatch: Adapt tests to be executed on 4.12 kernels Marcos Paulo de Souza
2026-04-15 12:01 ` Miroslav Benes
2026-04-15 12:37 ` Marcos Paulo de Souza
2026-04-16 13:24 ` Miroslav Benes
2026-04-16 17:07 ` Josh Poimboeuf
2026-04-16 18:18 ` Marcos Paulo de Souza
2026-04-17 18:36 ` Joe Lawrence
2026-04-20 9:46 ` Miroslav Benes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aeJNnFqLEdMgnHKh@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=mpdesouza@suse.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.