Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-27 Thread Borislav Petkov
On Sat, Jan 27, 2018 at 10:32:26AM +, David Woodhouse wrote: > No because cpuinfo should be information about the CPU. That argument doesn't work in this case because we're already lying there. Otherwise we would've never had the synthetic features in the first place. If you *really* wanna kn

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-27 Thread David Woodhouse
On Sat, 2018-01-27 at 10:37 +0100, Borislav Petkov wrote: > On Sat, Jan 27, 2018 at 09:27:48AM +, David Woodhouse wrote: > > > > http://david.woodhou.se/cleanup-feature-bits.patch on top of my full > > tree? > @@ -223,7 +223,7 @@ static inline void > indirect_branch_prediction_barrier(void) >

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-27 Thread Borislav Petkov
On Sat, Jan 27, 2018 at 09:27:48AM +, David Woodhouse wrote: > http://david.woodhou.se/cleanup-feature-bits.patch on top of my full > tree? @@ -223,7 +223,7 @@ static inline void indirect_branch_prediction_barrier(void) "movl %[val], %%eax\n\t"

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-27 Thread David Woodhouse
http://david.woodhou.se/cleanup-feature-bits.patch on top of my full tree? I'll rework that into the series instead of as a patch on top... smime.p7s Description: S/MIME cryptographic signature

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-27 Thread David Woodhouse
On Fri, 2018-01-26 at 17:14 -0600, Tom Lendacky wrote: > On 1/26/2018 4:10 PM, Borislav Petkov wrote: > > > > On Fri, Jan 26, 2018 at 09:59:44PM +, David Woodhouse wrote: > > > > > > If we wanted to do this kind of thing, we'd do it the other way round. > > > Turn the *Intel* feature into bot

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Tom Lendacky
On 1/26/2018 4:10 PM, Borislav Petkov wrote: > On Fri, Jan 26, 2018 at 09:59:44PM +, David Woodhouse wrote: >> If we wanted to do this kind of thing, we'd do it the other way round. >> Turn the *Intel* feature into both 'IBRS' and 'IBPB' CPU-visible >> features, and have those defined in the AM

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Borislav Petkov
On Fri, Jan 26, 2018 at 09:59:44PM +, David Woodhouse wrote: > If we wanted to do this kind of thing, we'd do it the other way round. > Turn the *Intel* feature into both 'IBRS' and 'IBPB' CPU-visible > features, and have those defined in the AMD word. You lost me here: have those defined in t

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread David Woodhouse
On Fri, 2018-01-26 at 22:52 +0100, Borislav Petkov wrote: > On Fri, Jan 26, 2018 at 03:06:20PM -0600, Tom Lendacky wrote: > > > > So I like the idea of AMD_IBRS/AMD_IBPB/AMD_STIBP and then use the magic > > quotes as appropriate.  We could probably use the magic quotes on > > AMD_STIBP and set X86

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Borislav Petkov
On Fri, Jan 26, 2018 at 03:06:20PM -0600, Tom Lendacky wrote: > So I like the idea of AMD_IBRS/AMD_IBPB/AMD_STIBP and then use the magic > quotes as appropriate. We could probably use the magic quotes on > AMD_STIBP and set X86_FEATURE_STIBP when we see X86_FEATURE_AMD_STIBP. Like this? We set t

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Tom Lendacky
On 1/26/2018 12:49 PM, Borislav Petkov wrote: > On Fri, Jan 26, 2018 at 06:45:18PM +, David Woodhouse wrote: >> On Fri, 2018-01-26 at 19:41 +0100, Borislav Petkov wrote: >>> +#define X86_FEATURE_AMD_IBPB   (13*32+12) /* "" Indirect Branch >>> Prediction Barrier MSR */ >> >> Stray quote

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Borislav Petkov
On Fri, Jan 26, 2018 at 06:45:18PM +, David Woodhouse wrote: > On Fri, 2018-01-26 at 19:41 +0100, Borislav Petkov wrote: > > +#define X86_FEATURE_AMD_IBPB   (13*32+12) /* "" Indirect Branch > > Prediction Barrier MSR */ > > Stray quotes. No no, those quotes are magical. :) They don'

Re: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread David Woodhouse
On Fri, 2018-01-26 at 19:41 +0100, Borislav Petkov wrote: > +#define X86_FEATURE_AMD_IBPB   (13*32+12) /* "" Indirect Branch > Prediction Barrier MSR */ Stray quotes. > +#define X86_FEATURE_IBRS   (13*32+14) /* Indirect Branch > Restricted Speculation */ Please don't call i

[PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits

2018-01-26 Thread Borislav Petkov
v Date: Fri, 26 Jan 2018 19:07:39 +0100 Subject: [PATCH] x86/cpufeatures: Cleanup AMD speculation feature bits X86_FEATURE_AMD_PRED_CMD -> X86_FEATURE_AMD_IBPB That is the preferred name. Also, hide it in /proc/cpuinfo as we're setting a vendor-agnostic X86_FEATURE_IBPB one. X86_FEATUR