]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
arm64: ssbs: Don't treat CPUs with SSBS as unaffected by SSB
authorWill Deacon <will.deacon@arm.com>
Thu, 24 Oct 2019 12:48:30 +0000 (14:48 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 18:04:50 +0000 (19:04 +0100)
BugLink: https://bugs.launchpad.net/bugs/1851876
[ Upstream commit eb337cdfcd5dd3b10522c2f34140a73a4c285c30 ]

SSBS provides a relatively cheap mitigation for SSB, but it is still a
mitigation and its presence does not indicate that the CPU is unaffected
by the vulnerability.

Tweak the mitigation logic so that we report the correct string in sysfs.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/arm64/kernel/cpu_errata.c

index 2898130c315638150da22d1b5a883f3db0ac70f0..55526738ccbc9f653a8ae43512a6e9687fcafcfd 100644 (file)
@@ -333,15 +333,17 @@ static bool has_ssbd_mitigation(const struct arm64_cpu_capabilities *entry,
 
        WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
 
+       /* delay setting __ssb_safe until we get a firmware response */
+       if (is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list))
+               this_cpu_safe = true;
+
        if (this_cpu_has_cap(ARM64_SSBS)) {
+               if (!this_cpu_safe)
+                       __ssb_safe = false;
                required = false;
                goto out_printmsg;
        }
 
-       /* delay setting __ssb_safe until we get a firmware response */
-       if (is_midr_in_range_list(read_cpuid_id(), entry->midr_range_list))
-               this_cpu_safe = true;
-
        if (psci_ops.smccc_version == SMCCC_VERSION_1_0) {
                ssbd_state = ARM64_SSBD_UNKNOWN;
                if (!this_cpu_safe)