From 36e1ad61e8771cb20f3a1f1d282dad0dd9036a04 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 20 May 2020 21:22:25 +0000 Subject: [PATCH] Do not consider CAP_RDCL_NO as an indicator for all MDS vulnerabilities handled by hardware. Reported by: Anthony Steinhauser admbugs: 962 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/x86/x86/cpu_machdep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index b17e0c679f40..f1f854159556 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -1078,11 +1078,11 @@ hw_mds_recalculate(void) * reported. For instance, hypervisor might unknowingly * filter the cap out. * For the similar reasons, and for testing, allow to enable - * mitigation even for RDCL_NO or MDS_NO caps. + * mitigation even when MDS_NO cap is set. */ if (cpu_vendor_id != CPU_VENDOR_INTEL || hw_mds_disable == 0 || - ((cpu_ia32_arch_caps & (IA32_ARCH_CAP_RDCL_NO | - IA32_ARCH_CAP_MDS_NO)) != 0 && hw_mds_disable == 3)) { + ((cpu_ia32_arch_caps & IA32_ARCH_CAP_MDS_NO) != 0 && + hw_mds_disable == 3)) { mds_handler = mds_handler_void; } else if (((cpu_stdext_feature3 & CPUID_STDEXT3_MD_CLEAR) != 0 && hw_mds_disable == 3) || hw_mds_disable == 1) {