mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Kevin Brodsky <kevin.brodsky@arm.com>, <catalin.marinas@arm.com>,
	<will@kernel.org>, <oleg@redhat.com>, <tglx@linutronix.de>,
	<peterz@infradead.org>, <luto@kernel.org>, <shuah@kernel.org>,
	<kees@kernel.org>, <wad@chromium.org>, <deller@gmx.de>,
	<akpm@linux-foundation.org>, <charlie@rivosinc.com>,
	<mark.rutland@arm.com>, <anshuman.khandual@arm.com>,
	<song@kernel.org>, <ryan.roberts@arm.com>, <thuth@redhat.com>,
	<ada.coupriediaz@arm.com>, <broonie@kernel.org>,
	<pengcan@kylinos.cn>, <liqiang01@kylinos.cn>, <kmal@cock.li>,
	<dvyukov@google.com>, <reddybalavignesh9979@gmail.com>,
	<richard.weiyang@gmail.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH v11 09/14] entry: Rework syscall_exit_to_user_mode_work() for arch reuse
Date: Thu, 29 Jan 2026 21:11:33 +0800	[thread overview]
Message-ID: <ef52449d-7ae0-11d0-c8a9-2ca572454425@huawei.com> (raw)
In-Reply-To: <56978cb8-f9de-4bf2-b1fc-b5564fec7387@arm.com>



On 2026/1/29 20:06, Kevin Brodsky wrote:
> On 28/01/2026 04:19, Jinjie Ruan wrote:
>> In the generic entry code, the beginning of
>> syscall_exit_to_user_mode_work() can be reused on arm64 so it makes
>> sense to rework it.
>>
>> In preparation for moving arm64 over to the generic entry
>> code, as nothing calls syscall_exit_to_user_mode_work() except for
>> syscall_exit_to_user_mode(), move local_irq_disable_exit_to_user() and
>> syscall_exit_to_user_mode_prepare() out from
>> syscall_exit_to_user_mode_work() to the only one caller.
>>
>> Also update the comment and no functional changes.
>>
>> Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
>> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>> ---
>>  include/linux/entry-common.h | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
>> index e4a8287af822..c4fea642d931 100644
>> --- a/include/linux/entry-common.h
>> +++ b/include/linux/entry-common.h
>> @@ -125,14 +125,14 @@ void syscall_exit_work(struct pt_regs *regs, unsigned long work);
>>   * syscall_exit_to_user_mode_work - Handle work before returning to user mode
>>   * @regs:	Pointer to currents pt_regs
>>   *
>> - * Same as step 1 and 2 of syscall_exit_to_user_mode() but without calling
>> + * Same as step 1 of syscall_exit_to_user_mode() but without calling
>> + * local_irq_disable(), syscall_exit_to_user_mode_prepare() and
>>   * exit_to_user_mode() to perform the final transition to user mode.
>>   *
>> - * Calling convention is the same as for syscall_exit_to_user_mode() and it
>> - * returns with all work handled and interrupts disabled. The caller must
>> - * invoke exit_to_user_mode() before actually switching to user mode to
>> - * make the final state transitions. Interrupts must stay disabled between
>> - * return from this function and the invocation of exit_to_user_mode().
>> + * Calling convention is the same as for syscall_exit_to_user_mode(). The
>> + * caller must invoke local_irq_disable(), __exit_to_user_mode_prepare() and
> 
> Shouldn't it be syscall_exit_to_user_mode_prepare() rather than
> __exit_to_user_mode_prepare()? The former has extra calls (e.g. rseq).

Perhaps we can just delete these comments — at present only generic
entry and arm64 use it, and nowhere else needs it; after the refactoring
the comments now seem rather unclear.

> 
> - Kevin
> 
>> + * exit_to_user_mode() before actually switching to user mode to
>> + * make the final state transitions.
>>   */
>>  static __always_inline void syscall_exit_to_user_mode_work(struct pt_regs *regs)
>>  {
>> @@ -155,8 +155,6 @@ static __always_inline void syscall_exit_to_user_mode_work(struct pt_regs *regs)
>>  	 */
>>  	if (unlikely(work & SYSCALL_WORK_EXIT))
>>  		syscall_exit_work(regs, work);
>> -	local_irq_disable_exit_to_user();
>> -	syscall_exit_to_user_mode_prepare(regs);
>>  }
>>  
>>  /**
>> @@ -192,6 +190,8 @@ static __always_inline void syscall_exit_to_user_mode(struct pt_regs *regs)
>>  {
>>  	instrumentation_begin();
>>  	syscall_exit_to_user_mode_work(regs);
>> +	local_irq_disable_exit_to_user();
>> +	syscall_exit_to_user_mode_prepare(regs);
>>  	instrumentation_end();
>>  	exit_to_user_mode();
>>  }
> 

  reply	other threads:[~2026-01-29 13:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28  3:19 [PATCH v11 00/14] arm64: entry: Convert to Generic Entry Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 01/14] entry: Remove unused syscall in syscall_trace_enter() Jinjie Ruan
2026-01-29 12:06   ` Kevin Brodsky
2026-01-30 10:11   ` Thomas Gleixner
2026-01-30 21:53   ` [tip: core/entry] entry: Remove unused syscall argument from syscall_trace_enter() tip-bot2 for Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 02/14] arm64/ptrace: Refactor syscall_trace_enter/exit() Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 03/14] arm64: ptrace: Move rseq_syscall() before audit_syscall_exit() Jinjie Ruan
2026-01-29 12:06   ` Kevin Brodsky
2026-01-29 13:06     ` Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 04/14] arm64: syscall: Rework el0_svc_common() Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 05/14] arm64/ptrace: Not check _TIF_SECCOMP/SYSCALL_EMU for syscall_exit_work() Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 06/14] arm64/ptrace: Do not report_syscall_exit() for PTRACE_SYSEMU_SINGLESTEP Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 07/14] arm64/ptrace: Expand secure_computing() in place Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 08/14] arm64/ptrace: Use syscall_get_arguments() helper Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 09/14] entry: Rework syscall_exit_to_user_mode_work() for arch reuse Jinjie Ruan
2026-01-29 12:06   ` Kevin Brodsky
2026-01-29 13:11     ` Jinjie Ruan [this message]
2026-01-29 16:00       ` Kevin Brodsky
2026-01-30 10:16         ` Thomas Gleixner
2026-01-30 13:27           ` Kevin Brodsky
2026-01-30 15:01             ` Thomas Gleixner
2026-01-30 23:33               ` Thomas Gleixner
2026-01-31  1:43               ` Jinjie Ruan
2026-01-30 21:53   ` [tip: core/entry] entry: Rework syscall_exit_to_user_mode_work() for architecture reuse tip-bot2 for Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 10/14] entry: Add arch_ptrace_report_syscall_entry/exit() Jinjie Ruan
2026-01-30 21:53   ` [tip: core/entry] " tip-bot2 for Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 11/14] arm64: entry: Convert to generic entry Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 12/14] arm64: Inline el0_svc_common() Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 13/14] entry: Inline syscall_exit_work() and syscall_trace_enter() Jinjie Ruan
2026-01-30 10:14   ` Thomas Gleixner
2026-01-31  1:48     ` Jinjie Ruan
2026-01-30 21:53   ` [tip: core/entry] " tip-bot2 for Jinjie Ruan
2026-01-28  3:19 ` [PATCH v11 14/14] selftests: sud_test: Support aarch64 Jinjie Ruan

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=ef52449d-7ae0-11d0-c8a9-2ca572454425@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=ada.coupriediaz@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=charlie@rivosinc.com \
    --cc=deller@gmx.de \
    --cc=dvyukov@google.com \
    --cc=kees@kernel.org \
    --cc=kevin.brodsky@arm.com \
    --cc=kmal@cock.li \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liqiang01@kylinos.cn \
    --cc=luto@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=oleg@redhat.com \
    --cc=pengcan@kylinos.cn \
    --cc=peterz@infradead.org \
    --cc=reddybalavignesh9979@gmail.com \
    --cc=richard.weiyang@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thuth@redhat.com \
    --cc=wad@chromium.org \
    --cc=will@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

all inboxes | Powered by JetHome®