Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-10 Thread Willy Tarreau
On Wed, Jan 10, 2018 at 09:59:01AM +0100, Ingo Molnar wrote: > > * Willy Tarreau wrote: > > > On Wed, Jan 10, 2018 at 09:01:02AM +0100, Ingo Molnar wrote: > > > > > > * Willy Tarreau wrote: > > > > > > > [...] If we had "pit_enabled", something like this could be confusing > > > > because >

Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-10 Thread Ingo Molnar
* Willy Tarreau wrote: > On Wed, Jan 10, 2018 at 09:01:02AM +0100, Ingo Molnar wrote: > > > > * Willy Tarreau wrote: > > > > > [...] If we had "pit_enabled", something like this could be confusing > > > because > > > it's not obvious whether this pti_enabled *enforces* PTI or if its > > >

Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-10 Thread Willy Tarreau
On Wed, Jan 10, 2018 at 09:01:02AM +0100, Ingo Molnar wrote: > > * Willy Tarreau wrote: > > > [...] If we had "pit_enabled", something like this could be confusing > > because > > it's not obvious whether this pti_enabled *enforces* PTI or if its absence > > disables it : > > > > cmpb $0

Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-10 Thread Ingo Molnar
* Willy Tarreau wrote: > [...] If we had "pit_enabled", something like this could be confusing because > it's not obvious whether this pti_enabled *enforces* PTI or if its absence > disables it : > > cmpb $0, PER_CPU_VAR(pti_enabled) > jz .Lend\@ The natural sequence would be:

Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-09 Thread Willy Tarreau
On Wed, Jan 10, 2018 at 08:19:51AM +0100, Ingo Molnar wrote: > > * Willy Tarreau wrote: > > > +#ifdef CONFIG_PAGE_TABLE_ISOLATION > > + this_cpu_write(pti_disable, > > + next_p->mm && next_p->mm->context.pti_disable); > > +#endif > > Another pet peeve, please write: > > > +

Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-09 Thread Ingo Molnar
* Willy Tarreau wrote: > +#ifdef CONFIG_PAGE_TABLE_ISOLATION > + this_cpu_write(pti_disable, > +next_p->mm && next_p->mm->context.pti_disable); > +#endif Another pet peeve, please write: > + this_cpu_write(pti_disable, next_p->mm && > next_p->mm->context.pti_disabl

[RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable

2018-01-09 Thread Willy Tarreau
This one is updated upon each context switch to reflect the crrent mm's pti_disable field. Signed-off-by: Willy Tarreau Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Dave Hansen Cc: Ingo Molnar Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Josh Poimboeuf Cc: