public inbox for live-patching@vger.kernel.org
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: Joe Lawrence <joe.lawrence@redhat.com>,
	 Josh Poimboeuf <jpoimboe@kernel.org>,
	Jiri Kosina <jikos@kernel.org>,  Petr Mladek <pmladek@suse.com>,
	Shuah Khan <shuah@kernel.org>,
	 live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/8] selftests: livepatch: test-syscall: Check for ARCH_HAS_SYSCALL_WRAPPER
Date: Wed, 1 Apr 2026 09:41:05 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.21.2604010937120.12688@pobox.suse.cz> (raw)
In-Reply-To: <a23f00ad4a454cbb3379cdf512e8c61ce7499194.camel@suse.com>

[-- Attachment #1: Type: text/plain, Size: 3208 bytes --]

On Tue, 31 Mar 2026, Marcos Paulo de Souza wrote:

> On Mon, 2026-03-16 at 16:12 -0400, Joe Lawrence wrote:
> > On Fri, Mar 13, 2026 at 05:58:32PM -0300, Marcos Paulo de Souza
> > wrote:
> > > Instead of checking if the architecture running the test was
> > > powerpc,
> > > check if CONF_ARCH_HAS_SYSCALL_WRAPPER is defined or not.
> > > 
> > > No functional changes.
> > > 
> > > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> > > ---
> > >  tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
> > > | 7 +++----
> > >  1 file changed, 3 insertions(+), 4 deletions(-)
> > > 
> > > diff --git
> > > a/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
> > > b/tools/testing/selftests/livepatch/test_modules/test_klp_syscall.c
> > > index dd802783ea849..c01a586866304 100644
> > > ---
> > > 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,14 @@
> > >  #include <linux/slab.h>
> > >  #include <linux/livepatch.h>
> > >  
> > > -#if defined(__x86_64__)
> > > +#if !defined(CONFIG_ARCH_HAS_SYSCALL_WRAPPER)
> > > +#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 */
> > > -#define FN_PREFIX
> > 
> > The patch does maintain the previous behavior, but I'm wondering if
> > the
> > original assertion about ARCH_HAS_SYSCALL_WRAPPER on Power was
> > correct:
> > 
> >   $ grep ARCH_HAS_SYSCALL_WRAPPER arch/powerpc/Kconfig
> >           select ARCH_HAS_SYSCALL_WRAPPER         if !SPU_BASE &&
> > !COMPAT
> >           depends on PPC64 && ARCH_HAS_SYSCALL_WRAPPER
> > 
> > Perhaps I just forgot what that additional piece of information that
> > explains the comment (highly probable these days), and if so, might
> > be
> > nice to add to this commit since I don't see it in 6a71770442b5
> > ("selftests: livepatch: Test livepatching a heavily called syscall").
> 
> Looking again at the code and at the symbols for SLE for ppc64le, I can
> say that, even with ARCH_HAS_SYSCALL_WRAPPER being set, the syscall
> names are not changed for ppc64le. Looking at
> arch/powerpc/kernel/systbl.c:
> 
> #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
> #define __SYSCALL(nr, entry) [nr] = entry,
> #else
> /*
>  * Coerce syscall handlers with arbitrary parameters to common type
>  * requires cast to void* to avoid -Wcast-function-type.
>  */
> #define __SYSCALL(nr, entry) [nr] = (void *) entry,
> #endif

I think this is not the complete picture though. The definition of the 
syscall table did not change but the actual wrappers (or syscall functions 
naming before) did change a couple of times even on powerpc if I am 
reading the git history right. ARCH_HAS_SYSCALL_WRAPPER also changed how 
syscall parameters are consumed (from registers to stack frame (pt_regs)). 
It is not particularly relevant for getpid() which is SYSCALL_DEFINE0() 
but I wanted to point that out.

Miroslav

  reply	other threads:[~2026-04-01  7:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 20:58 [PATCH 0/8] kselftests: livepatch: Adapt tests to be executed on 4.12 kernels Marcos Paulo de Souza
2026-03-13 20:58 ` [PATCH 1/8] selftests: livepatch: test-syscall: Check for ARCH_HAS_SYSCALL_WRAPPER Marcos Paulo de Souza
2026-03-16 20:12   ` Joe Lawrence
2026-03-19 12:54     ` Miroslav Benes
2026-03-19 14:11       ` Marcos Paulo de Souza
2026-03-20 10:45         ` Miroslav Benes
2026-03-27 13:24           ` Marcos Paulo de Souza
2026-03-27 13:16     ` Marcos Paulo de Souza
2026-03-31 18:54     ` Marcos Paulo de Souza
2026-04-01  7:41       ` Miroslav Benes [this message]
2026-03-13 20:58 ` [PATCH 2/8] selftests: livepatch: test-kprobe: Replace true/false mod param by 1/0 Marcos Paulo de Souza
2026-03-19 13:03   ` Miroslav Benes
2026-03-19 14:16     ` Marcos Paulo de Souza
2026-03-20 11:18       ` Miroslav Benes
2026-03-13 20:58 ` [PATCH 3/8] selftests: livepatch: test-kprobe: Check if kprobes can work with livepatches Marcos Paulo de Souza
2026-03-16 20:38   ` Joe Lawrence
2026-03-19 14:35     ` Marcos Paulo de Souza
2026-03-20 11:33       ` Petr Mladek
2026-03-27 13:43         ` Marcos Paulo de Souza
2026-03-13 20:58 ` [PATCH 4/8] selftests: livepatch: functions: Introduce check_sysfs_exists Marcos Paulo de Souza
2026-03-16 20:47   ` Joe Lawrence
2026-03-13 20:58 ` [PATCH 5/8] selftests: livepatch: sysfs: Split tests of replace attribute Marcos Paulo de Souza
2026-03-20 13:03   ` Miroslav Benes
2026-03-20 13:12   ` Petr Mladek
2026-03-13 20:58 ` [PATCH 6/8] selftests: livepatch: sysfs: Split tests of stack_order attribute Marcos Paulo de Souza
2026-03-13 20:58 ` [PATCH 7/8] selftests: livepatch: sysfs: Split tests of patched attribute Marcos Paulo de Souza
2026-03-13 20:58 ` [PATCH 8/8] selftests: livepatch: functions.sh: Extend check for taint flag kernel message Marcos Paulo de Souza
2026-03-20 13:04   ` Miroslav Benes
2026-03-20 13:26   ` Petr Mladek
2026-03-20 13:41     ` Marcos Paulo de Souza
2026-03-20 13:31 ` [PATCH 0/8] kselftests: livepatch: Adapt tests to be executed on 4.12 kernels Petr Mladek

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=alpine.LSU.2.21.2604010937120.12688@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --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=mpdesouza@suse.com \
    --cc=pmladek@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox