Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-29 Thread Ingo Molnar
* Dan Williams wrote: > > The flip side is that if the MFENCE stalls the STAC that is ahead of it > > could be > > processed for 'free' - while it's always post barrier with my suggestion. > > This 'for free' aspect is what I aiming for. Ok. > > > > But in any case

Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-29 Thread Ingo Molnar
* Dan Williams wrote: > > The flip side is that if the MFENCE stalls the STAC that is ahead of it > > could be > > processed for 'free' - while it's always post barrier with my suggestion. > > This 'for free' aspect is what I aiming for. Ok. > > > > But in any case it would be nice to see a

Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-29 Thread Dan Williams
On Sun, Jan 28, 2018 at 1:14 AM, Ingo Molnar wrote: > > * Dan Williams wrote: > >> --- a/arch/x86/include/asm/uaccess.h >> +++ b/arch/x86/include/asm/uaccess.h >> @@ -124,6 +124,11 @@ extern int __get_user_bad(void); >> >> #define __uaccess_begin()

Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-29 Thread Dan Williams
On Sun, Jan 28, 2018 at 1:14 AM, Ingo Molnar wrote: > > * Dan Williams wrote: > >> --- a/arch/x86/include/asm/uaccess.h >> +++ b/arch/x86/include/asm/uaccess.h >> @@ -124,6 +124,11 @@ extern int __get_user_bad(void); >> >> #define __uaccess_begin() stac() >> #define __uaccess_end() clac() >>

Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-28 Thread Ingo Molnar
* Dan Williams wrote: > --- a/arch/x86/include/asm/uaccess.h > +++ b/arch/x86/include/asm/uaccess.h > @@ -124,6 +124,11 @@ extern int __get_user_bad(void); > > #define __uaccess_begin() stac() > #define __uaccess_end() clac() > +#define __uaccess_begin_nospec()

Re: [PATCH v5 04/12] x86: introduce __uaccess_begin_nospec and ifence

2018-01-28 Thread Ingo Molnar
* Dan Williams wrote: > --- a/arch/x86/include/asm/uaccess.h > +++ b/arch/x86/include/asm/uaccess.h > @@ -124,6 +124,11 @@ extern int __get_user_bad(void); > > #define __uaccess_begin() stac() > #define __uaccess_end() clac() > +#define __uaccess_begin_nospec() \ > +({