]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
UBUNTU/SAUCE: x86/speculation/srbds: do not try to turn mitigation off when not supported
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 5 Jun 2020 18:14:21 +0000 (15:14 -0300)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Mon, 22 Jun 2020 20:23:52 +0000 (17:23 -0300)
When SRBDS is mitigated by TSX OFF, update_srbds_msr will still read and
write to MSR_IA32_MCU_OPT_CTRL even when that is not supported by the
microcode.

Checking for X86_FEATURE_SRBDS_CTRL as a CPU feature available makes more
sense than checking for SRBDS_MITIGATION_UCODE_NEEDED as the the found
"mitigation".

CVE-2020-0543
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/kernel/cpu/bugs.c

index 3c3f3e02683aa985471d14112bec6b4dfb5a2aac..5071177986446eca9c1f433ef2447665bac0a848 100644 (file)
@@ -425,7 +425,7 @@ void update_srbds_msr(void)
        if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
                return;
 
-       if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED)
+       if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL))
                return;
 
        rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl);