public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Paul Burton <paul.burton@mips.com>
Cc: linux-mips <linux-mips@linux-mips.org>,
	Peter Zijlstra <peterz@infradead.org>,
	James Hogan <jhogan@kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 2/4] MIPS: Add syscall detection for restartable sequences
Date: Fri, 15 Jun 2018 13:41:25 -0400 (EDT)	[thread overview]
Message-ID: <1881638448.14415.1529084485237.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20180614235211.31357-3-paul.burton@mips.com>

----- On Jun 14, 2018, at 7:52 PM, Paul Burton paul.burton@mips.com wrote:

> Syscalls are not allowed inside restartable sequences, so add a call to
> rseq_syscall() at the very beginning of the system call exit path when
> CONFIG_DEBUG_RSEQ=y. This will help us to detect whether there is a
> syscall issued erroneously inside a restartable sequence.
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> Cc: James Hogan <jhogan@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Cc: linux-mips@linux-mips.org
> Cc: linux-kernel@vger.kernel.org
> ---
> 
> arch/mips/kernel/entry.S | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S
> index 38a302919e6b..d7de8adcfcc8 100644
> --- a/arch/mips/kernel/entry.S
> +++ b/arch/mips/kernel/entry.S
> @@ -79,6 +79,10 @@ FEXPORT(ret_from_fork)
> 	jal	schedule_tail		# a0 = struct task_struct *prev
> 
> FEXPORT(syscall_exit)
> +#ifdef CONFIG_DEBUG_RSEQ
> +	move	a0, sp
> +	jal	rseq_syscall
> +#endif
> 	local_irq_disable		# make sure need_resched and
> 					# signals dont change between
> 					# sampling and return
> @@ -141,6 +145,10 @@ work_notifysig:				# deal with pending signals and
> 	j	resume_userspace_check
> 
> FEXPORT(syscall_exit_partial)
> +#ifdef CONFIG_DEBUG_RSEQ
> +	move	a0, sp
> +	jal	rseq_syscall
> +#endif
> 	local_irq_disable		# make sure need_resched doesn't
> 					# change between and return
> 	LONG_L	a2, TI_FLAGS($28)	# current->work

Just to double-check: you did test with CONFIG_DEBUG_RSEQ=y, right ?

Are there any live registers that need to be saved before calling
rseq_syscall ?

Thanks,

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2018-06-15 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 23:52 [PATCH 0/4] MIPS: Restartable sequences (rseq) support Paul Burton
2018-06-14 23:52 ` [PATCH 1/4] MIPS: Add support for restartable sequences Paul Burton
2018-06-14 23:52 ` [PATCH 2/4] MIPS: Add syscall detection " Paul Burton
2018-06-15 17:41   ` Mathieu Desnoyers [this message]
2018-06-15 18:43     ` Paul Burton
2018-06-16 20:28       ` Mathieu Desnoyers
2018-06-14 23:52 ` [PATCH 3/4] MIPS: Wire up the restartable sequences (rseq) syscall Paul Burton
2018-06-14 23:52 ` [PATCH 4/4] rseq/selftests: Implement MIPS support Paul Burton
2018-06-15 10:58   ` James Hogan
2018-06-15 17:37     ` Mathieu Desnoyers
2018-06-15 18:16     ` Paul Burton
2018-06-16 20:24 ` [PATCH 0/4] MIPS: Restartable sequences (rseq) support Mathieu Desnoyers

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=1881638448.14415.1529084485237.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=boqun.feng@gmail.com \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@mips.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.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