Skip to content

Commit ea156d1

Browse files
bonziniKAGA-KOKO
authored andcommitted
x86/speculation: Simplify sysfs report of VMX L1TF vulnerability
Three changes to the content of the sysfs file: - If EPT is disabled, L1TF cannot be exploited even across threads on the same core, and SMT is irrelevant. - If mitigation is completely disabled, and SMT is enabled, print "vulnerable" instead of "vulnerable, SMT vulnerable" - Reorder the two parts so that the main vulnerability state comes first and the detail on SMT is second. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 5833113 commit ea156d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,15 @@ static ssize_t l1tf_show_state(char *buf)
762762
if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_AUTO)
763763
return sprintf(buf, "%s\n", L1TF_DEFAULT_MSG);
764764

765-
return sprintf(buf, "%s; VMX: SMT %s, L1D %s\n", L1TF_DEFAULT_MSG,
766-
cpu_smt_control == CPU_SMT_ENABLED ? "vulnerable" : "disabled",
767-
l1tf_vmx_states[l1tf_vmx_mitigation]);
765+
if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_EPT_DISABLED ||
766+
(l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER &&
767+
cpu_smt_control == CPU_SMT_ENABLED))
768+
return sprintf(buf, "%s; VMX: %s\n", L1TF_DEFAULT_MSG,
769+
l1tf_vmx_states[l1tf_vmx_mitigation]);
770+
771+
return sprintf(buf, "%s; VMX: %s, SMT %s\n", L1TF_DEFAULT_MSG,
772+
l1tf_vmx_states[l1tf_vmx_mitigation],
773+
cpu_smt_control == CPU_SMT_ENABLED ? "vulnerable" : "disabled");
768774
}
769775
#else
770776
static ssize_t l1tf_show_state(char *buf)

0 commit comments

Comments
 (0)