linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Piotr Figiel <figiel@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	paulmck <paulmck@kernel.org>, Boqun Feng <boqun.feng@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>,
	Florian Weimer <fweimer@redhat.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Andrei Vagin <avagin@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Peter Oskolkov <posk@google.com>,
	Kamil Yurtsever <kyurtsever@google.com>,
	Chris Kennelly <ckennelly@google.com>,
	Paul Turner <pjt@google.com>, emmir <emmir@google.com>,
	linux-man <linux-man@vger.kernel.org>,
	linux-api <linux-api@vger.kernel.org>
Subject: Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request
Date: Thu, 11 Mar 2021 17:51:45 +0100	[thread overview]
Message-ID: <YEpKoa9PgjffO7Q5@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <1173189328.5477.1615474316906.JavaMail.zimbra@efficios.com>

On Thu, Mar 11, 2021 at 09:51:56AM -0500, Mathieu Desnoyers wrote:
> 
> 
> ----- On Feb 26, 2021, at 8:51 AM, Piotr Figiel figiel@google.com wrote:
> 
> > For userspace checkpoint and restore (C/R) a way of getting process state
> > containing RSEQ configuration is needed.
> > 
> > There are two ways this information is going to be used:
> > - to re-enable RSEQ for threads which had it enabled before C/R
> > - to detect if a thread was in a critical section during C/R
> > 
> > Since C/R preserves TLS memory and addresses RSEQ ABI will be restored
> > using the address registered before C/R.
> > 
> > Detection whether the thread is in a critical section during C/R is needed
> > to enforce behavior of RSEQ abort during C/R. Attaching with ptrace()
> > before registers are dumped itself doesn't cause RSEQ abort.
> > Restoring the instruction pointer within the critical section is
> > problematic because rseq_cs may get cleared before the control is passed
> > to the migrated application code leading to RSEQ invariants not being
> > preserved. C/R code will use RSEQ ABI address to find the abort handler
> > to which the instruction pointer needs to be set.
> > 
> > To achieve above goals expose the RSEQ ABI address and the signature value
> > with the new ptrace request PTRACE_GET_RSEQ_CONFIGURATION.
> > 
> > This new ptrace request can also be used by debuggers so they are aware
> > of stops within restartable sequences in progress.
> > 
> > Signed-off-by: Piotr Figiel <figiel@google.com>
> > Reviewed-by: Michal Miroslaw <emmir@google.com>
> 
> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

How do we route this? Do I stick this in tip/sched/core as being an rseq
patch?

  reply	other threads:[~2021-03-11 16:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-26 13:51 [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request Piotr Figiel
2021-02-26 15:32 ` Mathieu Desnoyers
2021-02-26 16:04   ` Michał Mirosław
2021-02-26 16:41     ` Mathieu Desnoyers
2021-02-26 16:06   ` Piotr Figiel
2021-03-03 18:55     ` Mathieu Desnoyers
2021-03-03 17:10   ` Florian Weimer
2021-03-10 18:50 ` Oleg Nesterov
2021-03-11 14:51 ` Mathieu Desnoyers
2021-03-11 16:51   ` Peter Zijlstra [this message]
2021-03-11 17:24     ` Mathieu Desnoyers
2021-03-17 13:13 ` [tip: sched/core] rseq, ptrace: Add " tip-bot2 for Piotr Figiel
2021-03-17 15:19 ` tip-bot2 for Piotr Figiel

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=YEpKoa9PgjffO7Q5@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=ckennelly@google.com \
    --cc=emmir@google.com \
    --cc=figiel@google.com \
    --cc=fweimer@redhat.com \
    --cc=kyurtsever@google.com \
    --cc=ldv@altlinux.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pjt@google.com \
    --cc=posk@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).