Commit e5925fb8 authored by Pawan Gupta's avatar Pawan Gupta Committed by Borislav Petkov

x86/bugs: Group MDS, TAA & Processor MMIO Stale Data mitigations

MDS, TAA and Processor MMIO Stale Data mitigations rely on clearing CPU
buffers. Moreover, status of these mitigations affects each other.
During boot, it is important to maintain the order in which these
mitigations are selected. This is especially true for
md_clear_update_mitigation() that needs to be called after MDS, TAA and
Processor MMIO Stale Data mitigation selection is done.

Introduce md_clear_select_mitigation(), and select all these mitigations
from there. This reflects relationships between these mitigations and
ensures proper ordering.
Signed-off-by: default avatarPawan Gupta <pawan.kumar.gupta@linux.intel.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 8cb861e9
...@@ -42,6 +42,7 @@ static void __init ssb_select_mitigation(void); ...@@ -42,6 +42,7 @@ static void __init ssb_select_mitigation(void);
static void __init l1tf_select_mitigation(void); static void __init l1tf_select_mitigation(void);
static void __init mds_select_mitigation(void); static void __init mds_select_mitigation(void);
static void __init md_clear_update_mitigation(void); static void __init md_clear_update_mitigation(void);
static void __init md_clear_select_mitigation(void);
static void __init taa_select_mitigation(void); static void __init taa_select_mitigation(void);
static void __init mmio_select_mitigation(void); static void __init mmio_select_mitigation(void);
static void __init srbds_select_mitigation(void); static void __init srbds_select_mitigation(void);
...@@ -122,19 +123,10 @@ void __init check_bugs(void) ...@@ -122,19 +123,10 @@ void __init check_bugs(void)
spectre_v2_select_mitigation(); spectre_v2_select_mitigation();
ssb_select_mitigation(); ssb_select_mitigation();
l1tf_select_mitigation(); l1tf_select_mitigation();
mds_select_mitigation(); md_clear_select_mitigation();
taa_select_mitigation();
mmio_select_mitigation();
srbds_select_mitigation(); srbds_select_mitigation();
l1d_flush_select_mitigation(); l1d_flush_select_mitigation();
/*
* As MDS, TAA and MMIO Stale Data mitigations are inter-related, update
* and print their mitigation after MDS, TAA and MMIO Stale Data
* mitigation selection is done.
*/
md_clear_update_mitigation();
arch_smt_update(); arch_smt_update();
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
...@@ -520,6 +512,20 @@ static void __init md_clear_update_mitigation(void) ...@@ -520,6 +512,20 @@ static void __init md_clear_update_mitigation(void)
pr_info("MMIO Stale Data: %s\n", mmio_strings[mmio_mitigation]); pr_info("MMIO Stale Data: %s\n", mmio_strings[mmio_mitigation]);
} }
static void __init md_clear_select_mitigation(void)
{
mds_select_mitigation();
taa_select_mitigation();
mmio_select_mitigation();
/*
* As MDS, TAA and MMIO Stale Data mitigations are inter-related, update
* and print their mitigation after MDS, TAA and MMIO Stale Data
* mitigation selection is done.
*/
md_clear_update_mitigation();
}
#undef pr_fmt #undef pr_fmt
#define pr_fmt(fmt) "SRBDS: " fmt #define pr_fmt(fmt) "SRBDS: " fmt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment