mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Radu Rendec <radu@rendec.net>
To: Thomas Gleixner <tglx@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Cc: "Michal Suchánek" <msuchanek@suse.de>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Shrikanth Hegde" <sshegde@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	"Huacai Chen" <chenhuacai@kernel.org>,
	loongarch@lists.linux.dev, "Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	linux-riscv@lists.infradead.org,
	"Sven Schnelle" <svens@linux.ibm.com>,
	linux-s390@vger.kernel.org, x86@kernel.org,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Jinjie Ruan" <ruanjinjie@huawei.com>,
	"Magnus Lindholm" <linmag7@gmail.com>,
	"Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>
Subject: Re: [patch 2/4] entry: Rework trace_syscall_enter()
Date: Tue, 14 Jul 2026 11:28:39 -0400	[thread overview]
Message-ID: <230256edbe24e417e0e80e31f5a7e7ca120692dc.camel@rendec.net> (raw)
In-Reply-To: <20260712141346.639115923@kernel.org>

On Sun, 2026-07-12 at 23:25 +0200, Thomas Gleixner wrote:
> Reread the syscall number from pt_regs and stop returning the eventually
> modified syscall number.
> 
> That moves the reread to the end of the syscall_trace_enter() and prepares
> for moving it to the call site.
> 
> No functional change.
> 
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> ---
>  include/linux/entry-common.h  |   10 ++++------
>  kernel/entry/syscall-common.c |    9 ++-------
>  2 files changed, 6 insertions(+), 13 deletions(-)
> 
> --- a/include/linux/entry-common.h
> +++ b/include/linux/entry-common.h
> @@ -58,7 +58,7 @@ static __always_inline bool arch_ptrace_
>  }
>  #endif
>  
> -long trace_syscall_enter(struct pt_regs *regs, long syscall);
> +void trace_syscall_enter(struct pt_regs *regs);
>  void trace_syscall_exit(struct pt_regs *regs, long ret);
>  void syscall_enter_audit(struct pt_regs *regs);
>  
> @@ -96,16 +96,14 @@ static __always_inline long syscall_trac
>  			return -1L;
>  	}
>  
> -	/* Either of the above might have changed the syscall number */
> -	syscall = syscall_get_nr(current, regs);
> -
>  	if (unlikely(work & SYSCALL_WORK_SYSCALL_TRACEPOINT))
> -		syscall = trace_syscall_enter(regs, syscall);
> +		trace_syscall_enter(regs);
>  
>  	if (unlikely(audit_context()))
>  		syscall_enter_audit(regs);
>  
> -	return syscall;
> +	/* Either of the above might have changed the syscall number */

nit: "Either" implies two items. I would rephrase it to "Any" to make
things clearer.

> +	return syscall_get_nr(current, regs);
>  }
>  
>  /**
> --- a/kernel/entry/syscall-common.c
> +++ b/kernel/entry/syscall-common.c
> @@ -8,14 +8,9 @@
>  
>  /* Out of line to prevent tracepoint code duplication */
>  
> -long trace_syscall_enter(struct pt_regs *regs, long syscall)
> +void trace_syscall_enter(struct pt_regs *regs)
>  {
> -	trace_sys_enter(regs, syscall);
> -	/*
> -	 * Probes or BPF hooks in the tracepoint may have changed the
> -	 * system call number. Reread it.
> -	 */
> -	return syscall_get_nr(current, regs);
> +	trace_sys_enter(regs, syscall_get_nr(current, regs));
>  }
>  
>  void trace_syscall_exit(struct pt_regs *regs, long ret)

With the above,

Reviewed-by: Radu Rendec <radu@rendec.net>

  parent reply	other threads:[~2026-07-14 15:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 21:25 [patch 0/4] entry: Rework syscall skip logic Thomas Gleixner
2026-07-12 21:25 ` [patch 1/4] entry: Rework syscall_audit_enter() Thomas Gleixner
2026-07-13  1:33   ` Jinjie Ruan
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 15:23   ` [patch 1/4] " Radu Rendec
2026-07-12 21:25 ` [patch 2/4] entry: Rework trace_syscall_enter() Thomas Gleixner
2026-07-13  1:36   ` Jinjie Ruan
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 15:28   ` Radu Rendec [this message]
2026-07-12 21:25 ` [patch 3/4] entry: Make return type of syscall_trace_enter() bool Thomas Gleixner
2026-07-13  1:40   ` Jinjie Ruan
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 15:41   ` [patch 3/4] " Radu Rendec
2026-07-12 21:25 ` [patch 4/4] entry, treewide: Make syscall_enter_from_user_mode[_work]() indicate syscall execution Thomas Gleixner
2026-07-13  8:44   ` Michal Suchánek
2026-07-13 17:00     ` Michal Suchánek
2026-07-13 22:20     ` Thomas Gleixner
2026-07-14  7:29       ` Michal Suchánek
2026-07-14  8:40         ` Michal Suchánek
2026-07-14 15:01   ` [tip: core/entry] " tip-bot2 for Thomas Gleixner
2026-07-14 18:57   ` [patch 4/4] " Radu Rendec
2026-07-14 12:27 ` [patch 0/4] entry: Rework syscall skip logic Michal Suchánek

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=230256edbe24e417e0e80e31f5a7e7ca120692dc.camel@rendec.net \
    --to=radu@rendec.net \
    --cc=chenhuacai@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linmag7@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=loongarch@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=mkchauras@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sshegde@linux.ibm.com \
    --cc=svens@linux.ibm.com \
    --cc=tglx@kernel.org \
    --cc=x86@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