Skip to content

Commit 809af4e

Browse files
committed
x86/speculation/srbds: Do not try to turn mitigation off when not supported
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Ricardo Cañuelo <ricardo.canuelo@collabora.com> commit 0205f8a When SRBDS is mitigated by TSX OFF, update_srbds_msr() will still read and write to MSR_IA32_MCU_OPT_CTRL even when that MSR is not supported due to not having loaded the appropriate microcode. Check for X86_FEATURE_SRBDS_CTRL which is set only when the respective microcode which adds MSR_IA32_MCU_OPT_CTRL is loaded. Based on a patch by Thadeu Lima de Souza Cascardo <cascardo@canonical.com>. [ bp: Massage commit message. ] Suggested-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20220401074517.1848264-1-ricardo.canuelo@collabora.com (cherry picked from commit 0205f8a) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent ea57386 commit 809af4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,13 @@ void update_srbds_msr(void)
593593
if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED)
594594
return;
595595

596+
/*
597+
* A MDS_NO CPU for which SRBDS mitigation is not needed due to TSX
598+
* being disabled and it hasn't received the SRBDS MSR microcode.
599+
*/
600+
if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL))
601+
return;
602+
596603
rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl);
597604

598605
switch (srbds_mitigation) {

0 commit comments

Comments
 (0)