Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-11 Thread Mathieu Desnoyers
- On Mar 11, 2021, at 11:51 AM, Peter Zijlstra pet...@infradead.org wrote: > On Thu, Mar 11, 2021 at 09:51:56AM -0500, Mathieu Desnoyers wrote: >> >> >> - On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@google.com wrote: >> >> > For userspace checkpoint and restore (C/R) a way of

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-11 Thread Peter Zijlstra
On Thu, Mar 11, 2021 at 09:51:56AM -0500, Mathieu Desnoyers wrote: > > > - On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@google.com wrote: > > > For userspace checkpoint and restore (C/R) a way of getting process state > > containing RSEQ configuration is needed. > > > > There are two

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-11 Thread Mathieu Desnoyers
- On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@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

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-10 Thread Oleg Nesterov
I don't think I can review this patch, I don't understand the problem space well enough. But just in case, I see nothing wrong in this simple patch. Feel free to add Acked-by: Oleg Nesterov On 02/26, Piotr Figiel wrote: > > For userspace checkpoint and restore (C/R) a way of getting process

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-03 Thread Mathieu Desnoyers
- On Feb 26, 2021, at 11:06 AM, Piotr Figiel fig...@google.com wrote: > Hi, > > On Fri, Feb 26, 2021 at 10:32:35AM -0500, Mathieu Desnoyers wrote: >> > +static long ptrace_get_rseq_configuration(struct task_struct *task, >> > +unsigned long size, void

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-03-03 Thread Florian Weimer
* Mathieu Desnoyers: > This way, the configuration structure can be expanded in the future. The > rseq ABI structure is by definition fixed-size, so there is no point in > having its size here. > > Florian, did I understand your request correctly, or am I missing your > point ? No, the idea was

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Mathieu Desnoyers
- On Feb 26, 2021, at 11:04 AM, emmir em...@google.com wrote: > On Fri, 26 Feb 2021 at 16:32, Mathieu Desnoyers > wrote: >> >> - On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@google.com wrote: >> [...] >> > --- >> > v2: >> > Applied review comments: >> > - changed return value from

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Piotr Figiel
Hi, On Fri, Feb 26, 2021 at 10:32:35AM -0500, Mathieu Desnoyers wrote: > > +static long ptrace_get_rseq_configuration(struct task_struct *task, > > + unsigned long size, void __user *data) > > +{ > > + struct ptrace_rseq_configuration conf = { > > +

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Michał Mirosław
On Fri, 26 Feb 2021 at 16:32, Mathieu Desnoyers wrote: > > - On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@google.com wrote: > [...] > > --- > > v2: > > Applied review comments: > > - changed return value from the ptrace request to the size of the > > configuration structure > > -

Re: [PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Mathieu Desnoyers
- On Feb 26, 2021, at 8:51 AM, Piotr Figiel fig...@google.com wrote: [...] > --- > v2: > Applied review comments: > - changed return value from the ptrace request to the size of the > configuration structure > - expanded configuration structure with the flags field and > the rseq abi

[PATCH v2] ptrace: add PTRACE_GET_RSEQ_CONFIGURATION request

2021-02-26 Thread Piotr Figiel
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