powerpc/fsl: Update Spectre v2 reporting
authorDiana Craciun <diana.craciun@nxp.com>
Fri, 29 Mar 2019 11:26:17 +0000 (22:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:25:15 +0000 (06:25 +0200)
commit dfa88658fb0583abb92e062c7a9cd5a5b94f2a46 upstream.

Report branch predictor state flush as a mitigation for
Spectre variant 2.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/security.c

index 7a611a187b532a78b4b7b74797f49168d63b4fb8..720a7a912d0dd722c1c3f6584be23201a8f34567 100644 (file)
@@ -212,8 +212,11 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, c
 
                if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW)
                        seq_buf_printf(&s, "(hardware accelerated)");
-       } else
+       } else if (btb_flush_enabled) {
+               seq_buf_printf(&s, "Mitigation: Branch predictor state flush");
+       } else {
                seq_buf_printf(&s, "Vulnerable");
+       }
 
        seq_buf_printf(&s, "\n");