powerpc/fsl: Fix spectre_v2 mitigations reporting
authorDiana Craciun <[email protected]>
Wed, 12 Dec 2018 14:03:02 +0000 (16:03 +0200)
committerMichael Ellerman <[email protected]>
Thu, 20 Dec 2018 11:59:03 +0000 (22:59 +1100)
Currently for CONFIG_PPC_FSL_BOOK3E the spectre_v2 file is incorrect:

  $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2
  "Mitigation: Software count cache flush"

Which is wrong. Fix it to report vulnerable for now.

Fixes: ee13cb249fab ("powerpc/64s: Add support for software count cache flush")
Cc: [email protected] # v4.19+
Signed-off-by: Diana Craciun <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
arch/powerpc/kernel/security.c

index 9703dce363075063ab0e9e961ad53f730e0bfd24..9e5f949a7ed80094ca7491921ca8a004fa00bf5f 100644 (file)
@@ -23,7 +23,7 @@ enum count_cache_flush_type {
        COUNT_CACHE_FLUSH_SW    = 0x2,
        COUNT_CACHE_FLUSH_HW    = 0x4,
 };
-static enum count_cache_flush_type count_cache_flush_type;
+static enum count_cache_flush_type count_cache_flush_type = COUNT_CACHE_FLUSH_NONE;
 
 bool barrier_nospec_enabled;
 static bool no_nospec;