lkml.org 
[lkml]   [2018]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch v3 04/13] x86/speculation: Disable STIBP when enhanced IBRS is in use
On Wed, 17 Oct 2018, Tim Chen wrote:

> With enhanced IBRS in use, the application running on sibling CPU will not

on a hyperthread sibling

> be able to launch Spectre v2 attack to the application on current CPU.

That's technically wrong. It still can launch an attack, but the attack
wont work.

So this wants to be:

will not be able to exploit the Spectre V2 vulnerability.

> @@ -881,7 +889,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
> ", IBPB" : "",
> boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ?
> ", IBRS_FW" : "",
> - (x86_spec_ctrl_base & SPEC_CTRL_STIBP) ?
> + spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED ?
> + ", Enhanced IBRS" :
> + (x86_spec_ctrl_base & SPEC_CTRL_STIBP) ?
> ", STIBP" : "",

This is more than horrible, really. Can you please do the following:

1) Split the sprintf() into a helper function in a first patch, which
spares a ibdentation level. i.e. what you tried in 2/13

2) If that condition still needs ugly unreadable line breaks, then split it
out into a helper function as well.

Thanks,

tglx

\
 
 \ /
  Last update: 2018-10-18 14:59    [W:0.566 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site