Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-13 Thread Tom Lendacky
On 09/12/2018 04:26 PM, Tim Chen wrote: > On 09/12/2018 10:16 AM, Tom Lendacky wrote: >> >> >> On 09/11/2018 04:16 PM, Thomas Gleixner wrote: >>> On Tue, 11 Sep 2018, Tim Chen wrote: On 09/10/2018 04:46 AM, Jiri Kosina wrote: > Nah, IBPB is actuall there, sorry. So I'll add reporting of ST

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-12 Thread Tim Chen
On 09/12/2018 02:45 PM, Jiri Kosina wrote: > On Wed, 12 Sep 2018, Tim Chen wrote: > >> I'm working on a patch for choosing the Spectre v2 app to app >> mitigation option. >> >> Something like the following: >> >> enum spectre_v2_app2app_mitigation { >> SPECTRE_V2_APP2APP_NONE, >> S

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-12 Thread Jiri Kosina
On Wed, 12 Sep 2018, Tim Chen wrote: > I'm working on a patch for choosing the Spectre v2 app to app > mitigation option. > > Something like the following: > > enum spectre_v2_app2app_mitigation { > SPECTRE_V2_APP2APP_NONE, > SPECTRE_V2_APP2APP_LITE, > SPECTRE_V2_APP2APP_

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-12 Thread Tim Chen
On 09/12/2018 10:16 AM, Tom Lendacky wrote: > > > On 09/11/2018 04:16 PM, Thomas Gleixner wrote: >> On Tue, 11 Sep 2018, Tim Chen wrote: >>> On 09/10/2018 04:46 AM, Jiri Kosina wrote: Nah, IBPB is actuall there, sorry. So I'll add reporting of STIBP + fixup the missing reporting of RSB

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-12 Thread Tom Lendacky
On 09/11/2018 04:16 PM, Thomas Gleixner wrote: > On Tue, 11 Sep 2018, Tim Chen wrote: >> On 09/10/2018 04:46 AM, Jiri Kosina wrote: >>> Nah, IBPB is actuall there, sorry. So I'll add reporting of STIBP + fixup >>> the missing reporting of RSB_CTXSW for v6. >>> >> >> I anticipate that STIBP coul

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-11 Thread Thomas Gleixner
On Tue, 11 Sep 2018, Thomas Gleixner wrote: > On Tue, 11 Sep 2018, Tim Chen wrote: > > On 09/10/2018 04:46 AM, Jiri Kosina wrote: > > > Nah, IBPB is actuall there, sorry. So I'll add reporting of STIBP + fixup > > > the missing reporting of RSB_CTXSW for v6. > > > > > > > I anticipate that STIB

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-11 Thread Thomas Gleixner
On Tue, 11 Sep 2018, Tim Chen wrote: > On 09/10/2018 04:46 AM, Jiri Kosina wrote: > > Nah, IBPB is actuall there, sorry. So I'll add reporting of STIBP + fixup > > the missing reporting of RSB_CTXSW for v6. > > > > I anticipate that STIBP could affect workloads with a lot of indirect > branches

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-11 Thread Tim Chen
On 09/10/2018 04:46 AM, Jiri Kosina wrote: > On Mon, 10 Sep 2018, Jiri Kosina wrote: > >>> That looks much more palatable. One missing piece is the sysfs >>> mitigation file for spectre v2. That should reflect STIPB state as well. >> >> FWIW, we're missing a bit more in that area, namely RSB stuf

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-10 Thread Jiri Kosina
On Mon, 10 Sep 2018, Jiri Kosina wrote: > > That looks much more palatable. One missing piece is the sysfs > > mitigation file for spectre v2. That should reflect STIPB state as well. > > FWIW, we're missing a bit more in that area, namely RSB stuffing on > context switch, IBRS (even through on

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-10 Thread Jiri Kosina
On Mon, 10 Sep 2018, Thomas Gleixner wrote: > That looks much more palatable. One missing piece is the sysfs > mitigation file for spectre v2. That should reflect STIPB state as well. FWIW, we're missing a bit more in that area, namely RSB stuffing on context switch, IBRS (even through only aro

Re: [PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-10 Thread Thomas Gleixner
On Mon, 10 Sep 2018, Jiri Kosina wrote: > +static void update_stibp_msr(void *info) > +{ > + wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base); > +} > + > +void arch_smt_update(void) > +{ > + if (stibp_needed()) { if (!stib_needed()) return; spares you an indentation

[PATCH v5 2/2] x86/speculation: Enable cross-hyperthread spectre v2 STIBP mitigation

2018-09-10 Thread Jiri Kosina
From: Jiri Kosina STIBP is a feature provided by certain Intel ucodes / CPUs. This feature (once enabled) prevents cross-hyperthread control of decisions made by indirect branch predictors. Enable this feature if - the CPU is vulnerable to spectre v2 - the CPU supports SMT and has SMT siblings