Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Thomas Gleixner
On Thu, Nov 19 2020 at 20:55, Alexandre Chartre wrote: > On 11/19/20 8:10 PM, Thomas Gleixner wrote: > Sorry I mixed up a few thing; I got confused with my own code which is not a > good sign... > > It's not sleeping with the user page-table which, as you mentioned, doesn't > make sense, it's sleep

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Alexandre Chartre
On 11/19/20 8:10 PM, Thomas Gleixner wrote: On Mon, Nov 16 2020 at 19:10, Alexandre Chartre wrote: On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: When executing more code in the kernel, we are likely to reach a point where we need to sle

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Thomas Gleixner
On Mon, Nov 16 2020 at 19:10, Alexandre Chartre wrote: > On 11/16/20 5:57 PM, Andy Lutomirski wrote: >> On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre >> wrote: > When executing more code in the kernel, we are likely to reach a point > where we need to sleep while we are using the user page-tab

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Alexandre Chartre
On 11/19/20 5:06 PM, Andy Lutomirski wrote: On Thu, Nov 19, 2020 at 4:06 AM Alexandre Chartre wrote: On 11/19/20 9:05 AM, Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the per-cpu trampoline stack. Like the trampoline stack, the PTI

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Andy Lutomirski
On Thu, Nov 19, 2020 at 4:06 AM Alexandre Chartre wrote: > > > > On 11/19/20 9:05 AM, Alexandre Chartre wrote: > > > > When entering the kernel from userland, use the per-task PTI stack > > instead of the per-cpu trampoline stack. Like the trampoline stack, > > the

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Alexandre Chartre
On 11/19/20 9:05 AM, Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the per-cpu trampoline stack. Like the trampoline stack, the PTI stack is mapped both in the kernel and in the user page-table. Using a per-task stack which is mapped in

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-19 Thread Alexandre Chartre
On 11/19/20 2:49 AM, Andy Lutomirski wrote: On Tue, Nov 17, 2020 at 8:59 AM Alexandre Chartre wrote: On 11/17/20 4:52 PM, Andy Lutomirski wrote: On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre wrote: On 11/16/20 7:34 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 10:10 AM Ale

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-18 Thread Andy Lutomirski
On Tue, Nov 17, 2020 at 8:59 AM Alexandre Chartre wrote: > > > > On 11/17/20 4:52 PM, Andy Lutomirski wrote: > > On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre > > wrote: > >> > >> > >> > >> On 11/16/20 7:34 PM, Andy Lutomirski wrote: > >>> On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre >

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-17 Thread Alexandre Chartre
On 11/17/20 4:52 PM, Andy Lutomirski wrote: On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre wrote: On 11/16/20 7:34 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre wrote: On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alex

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-17 Thread Andy Lutomirski
On Tue, Nov 17, 2020 at 7:07 AM Alexandre Chartre wrote: > > > > On 11/16/20 7:34 PM, Andy Lutomirski wrote: > > On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre > > wrote: > >> > >> > >> On 11/16/20 5:57 PM, Andy Lutomirski wrote: > >>> On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre > >>>

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-17 Thread Alexandre Chartre
On 11/16/20 7:34 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre wrote: On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the p

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-17 Thread Alexandre Chartre
On 11/16/20 10:24 PM, David Laight wrote: From: Alexandre Chartre Sent: 16 November 2020 18:10 On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the per-cpu tra

RE: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-16 Thread David Laight
From: Alexandre Chartre > Sent: 16 November 2020 18:10 > > On 11/16/20 5:57 PM, Andy Lutomirski wrote: > > On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre > > wrote: > >> > >> When entering the kernel from userland, use the per-task PTI stack > >> instead of the per-cpu trampoline stack. Like t

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-16 Thread Alexandre Chartre
On 11/16/20 7:34 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre wrote: On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the p

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-16 Thread Andy Lutomirski
On Mon, Nov 16, 2020 at 10:10 AM Alexandre Chartre wrote: > > > On 11/16/20 5:57 PM, Andy Lutomirski wrote: > > On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre > > wrote: > >> > >> When entering the kernel from userland, use the per-task PTI stack > >> instead of the per-cpu trampoline stack. L

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-16 Thread Alexandre Chartre
On 11/16/20 5:57 PM, Andy Lutomirski wrote: On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: When entering the kernel from userland, use the per-task PTI stack instead of the per-cpu trampoline stack. Like the trampoline stack, the PTI stack is mapped both in the kernel and in the us

Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack

2020-11-16 Thread Andy Lutomirski
On Mon, Nov 16, 2020 at 6:47 AM Alexandre Chartre wrote: > > When entering the kernel from userland, use the per-task PTI stack > instead of the per-cpu trampoline stack. Like the trampoline stack, > the PTI stack is mapped both in the kernel and in the user page-table. > Using a per-task stack wh