Re: [Patch v3 04/13] x86/speculation: Disable STIBP when enhanced IBRS is in use
From: Thomas Gleixner
Date: Thu Oct 18 2018 - 08:59:17 EST
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
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.