Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-28 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Tim Chen wrote: > I think it will be cleaner just to fold the msr update into > __speculation_ctrl_update to fix this issue. Yes, that looks nicer and avoids a couple of extra static_cpu_has() evaluations. I'll fold it into the proper places. Thanks, tglx

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-28 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Tim Chen wrote: > I think it will be cleaner just to fold the msr update into > __speculation_ctrl_update to fix this issue. Yes, that looks nicer and avoids a couple of extra static_cpu_has() evaluations. I'll fold it into the proper places. Thanks, tglx

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Lendacky, Thomas
On 11/27/2018 02:42 PM, Thomas Gleixner wrote: > On Tue, 27 Nov 2018, Thomas Gleixner wrote: >> On Tue, 27 Nov 2018, Lendacky, Thomas wrote: >>> On 11/25/2018 12:33 PM, Thomas Gleixner wrote: --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -406,6 +406,11 @@ static

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Lendacky, Thomas
On 11/27/2018 02:42 PM, Thomas Gleixner wrote: > On Tue, 27 Nov 2018, Thomas Gleixner wrote: >> On Tue, 27 Nov 2018, Lendacky, Thomas wrote: >>> On 11/25/2018 12:33 PM, Thomas Gleixner wrote: --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -406,6 +406,11 @@ static

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Thomas Gleixner wrote: > On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > > --- a/arch/x86/kernel/process.c > > > +++ b/arch/x86/kernel/process.c > > > @@ -406,6 +406,11 @@ static __always_inline void spec_ctrl_up > > > if

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Thomas Gleixner wrote: > On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > > --- a/arch/x86/kernel/process.c > > > +++ b/arch/x86/kernel/process.c > > > @@ -406,6 +406,11 @@ static __always_inline void spec_ctrl_up > > > if

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > --- a/arch/x86/kernel/process.c > > +++ b/arch/x86/kernel/process.c > > @@ -406,6 +406,11 @@ static __always_inline void spec_ctrl_up > > if (static_cpu_has(X86_FEATURE_SSBD)) > > msr

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Thomas Gleixner
On Tue, 27 Nov 2018, Lendacky, Thomas wrote: > On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > > --- a/arch/x86/kernel/process.c > > +++ b/arch/x86/kernel/process.c > > @@ -406,6 +406,11 @@ static __always_inline void spec_ctrl_up > > if (static_cpu_has(X86_FEATURE_SSBD)) > > msr

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Tim Chen
On 11/27/2018 09:25 AM, Lendacky, Thomas wrote: >> --- a/arch/x86/kernel/cpu/bugs.c >> +++ b/arch/x86/kernel/cpu/bugs.c >> @@ -148,6 +148,10 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, >> static_cpu_has(X86_FEATURE_AMD_SSBD)) >> hostval |=

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Tim Chen
On 11/27/2018 09:25 AM, Lendacky, Thomas wrote: >> --- a/arch/x86/kernel/cpu/bugs.c >> +++ b/arch/x86/kernel/cpu/bugs.c >> @@ -148,6 +148,10 @@ x86_virt_spec_ctrl(u64 guest_spec_ctrl, >> static_cpu_has(X86_FEATURE_AMD_SSBD)) >> hostval |=

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Lendacky, Thomas
On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > To avoid the overhead of STIBP always on, it's necessary to allow per task > control of STIBP. > > Add a new task flag TIF_SPEC_IB and evaluate it during context switch if > SMT is active and flag evaluation is enabled by the speculation control >

Re: [patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-27 Thread Lendacky, Thomas
On 11/25/2018 12:33 PM, Thomas Gleixner wrote: > To avoid the overhead of STIBP always on, it's necessary to allow per task > control of STIBP. > > Add a new task flag TIF_SPEC_IB and evaluate it during context switch if > SMT is active and flag evaluation is enabled by the speculation control >

[patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-25 Thread Thomas Gleixner
To avoid the overhead of STIBP always on, it's necessary to allow per task control of STIBP. Add a new task flag TIF_SPEC_IB and evaluate it during context switch if SMT is active and flag evaluation is enabled by the speculation control code. Add the conditional evaluation to

[patch V2 18/28] x86/speculation: Prepare for per task indirect branch speculation control

2018-11-25 Thread Thomas Gleixner
To avoid the overhead of STIBP always on, it's necessary to allow per task control of STIBP. Add a new task flag TIF_SPEC_IB and evaluate it during context switch if SMT is active and flag evaluation is enabled by the speculation control code. Add the conditional evaluation to