|
|
@@ -1154,6 +1154,22 @@ static ssize_t l1tf_show_state(char *buf)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+static ssize_t mds_show_state(char *buf)
|
|
|
+{
|
|
|
+ if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
|
|
|
+ return sprintf(buf, "%s; SMT Host state unknown\n",
|
|
|
+ mds_strings[mds_mitigation]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (boot_cpu_has(X86_BUG_MSBDS_ONLY)) {
|
|
|
+ return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
|
|
+ sched_smt_active() ? "mitigated" : "disabled");
|
|
|
+ }
|
|
|
+
|
|
|
+ return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
|
|
+ sched_smt_active() ? "vulnerable" : "disabled");
|
|
|
+}
|
|
|
+
|
|
|
static char *stibp_state(void)
|
|
|
{
|
|
|
if (spectre_v2_enabled == SPECTRE_V2_IBRS_ENHANCED)
|
|
|
@@ -1218,6 +1234,10 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
|
|
|
if (boot_cpu_has(X86_FEATURE_L1TF_PTEINV))
|
|
|
return l1tf_show_state(buf);
|
|
|
break;
|
|
|
+
|
|
|
+ case X86_BUG_MDS:
|
|
|
+ return mds_show_state(buf);
|
|
|
+
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -1249,4 +1269,9 @@ ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *b
|
|
|
{
|
|
|
return cpu_show_common(dev, attr, buf, X86_BUG_L1TF);
|
|
|
}
|
|
|
+
|
|
|
+ssize_t cpu_show_mds(struct device *dev, struct device_attribute *attr, char *buf)
|
|
|
+{
|
|
|
+ return cpu_show_common(dev, attr, buf, X86_BUG_MDS);
|
|
|
+}
|
|
|
#endif
|