Commit a97895fe authored by Juerg Haefliger's avatar Juerg Haefliger Committed by Khalid Elmously

UBUNTU: SAUCE: powerpc/speculation: Support 'mitigations=' cmdline option

BugLink: https://bugs.launchpad.net/bugs/1830176

The update to stable 4.4.180 added powerpc Spectre v1 and v2 mitigations,
so configure them with the 'mitigations=' cmdline option.

From upstream commit 782e69ef ("powerpc/speculation: Support
'mitigations=' cmdline option").
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent ed00df1c
...@@ -2271,7 +2271,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -2271,7 +2271,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
expose users to several CPU vulnerabilities. expose users to several CPU vulnerabilities.
Equivalent to: nopti [X86,PPC] Equivalent to: nopti [X86,PPC]
nobp=0 [S390] nobp=0 [S390]
nospectre_v2 [X86,S390] nospectre_v1 [PPC]
nospectre_v2 [X86,PPC,S390]
spec_store_bypass_disable=off [X86,PPC] spec_store_bypass_disable=off [X86,PPC]
l1tf=off [X86] l1tf=off [X86]
mds=off [X86] mds=off [X86]
......
...@@ -58,7 +58,7 @@ void setup_barrier_nospec(void) ...@@ -58,7 +58,7 @@ void setup_barrier_nospec(void)
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR); security_ftr_enabled(SEC_FTR_BNDS_CHK_SPEC_BAR);
if (!no_nospec) if (!no_nospec && !cpu_mitigations_off())
enable_barrier_nospec(enable); enable_barrier_nospec(enable);
} }
...@@ -117,7 +117,7 @@ static int __init handle_nospectre_v2(char *p) ...@@ -117,7 +117,7 @@ static int __init handle_nospectre_v2(char *p)
early_param("nospectre_v2", handle_nospectre_v2); early_param("nospectre_v2", handle_nospectre_v2);
void setup_spectre_v2(void) void setup_spectre_v2(void)
{ {
if (no_spectrev2) if (no_spectrev2 || cpu_mitigations_off())
do_btb_flush_fixups(); do_btb_flush_fixups();
else else
btb_flush_enabled = true; btb_flush_enabled = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment