Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <mpdesouza@suse.com>
To: Miroslav Benes <mbenes@suse.cz>
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: Fri, 27 Mar 2026 10:24:05 -0300	[thread overview]
Message-ID: <9a72dbd0523254209a733ec9e89466e7f0dc3e00.camel@suse.com> (raw)
In-Reply-To: <alpine.LSU.2.21.2603201136401.12616@pobox.suse.cz>

On Fri, 2026-03-20 at 11:45 +0100, Miroslav Benes wrote:
> > > 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.

Exactly. The definition was added on

  commit 1bd21c6c21e848996339508d3ffb106d505256a8
  Author: Dominik Brodowski <linux@dominikbrodowski.net>
  Date:   Thu Apr 5 11:53:01 2018 +0200
  
      syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y

> 
> 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.

Well, it seems too much for a simple test to me, but I can do that, no
problem.

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

Makes sense, I'll change it.

> 
> What do you think? Am I off again?

I agree with everything, but adding another header file seems a little
too much work for a simple test case, but it's doable. Let me work on
it.

> 
> Miroslav

  reply	other threads:[~2026-03-27 13:24 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 [this message]
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
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=9a72dbd0523254209a733ec9e89466e7f0dc3e00.camel@suse.com \
    --to=mpdesouza@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=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