From: Alejandro Jimenez Date: Wed, 12 Dec 2018 02:09:34 +0000 (-0500) Subject: x86/speculation: Fix bad argument to rdmsrl() in cpu_set_bug_bits() X-Git-Tag: v4.1.12-124.31.3~377 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f358bb7ddd2f12747a7cae17fb24fc76a04e8e3b;p=users%2Fjedix%2Flinux-maple.git x86/speculation: Fix bad argument to rdmsrl() in cpu_set_bug_bits() At the beginning of cpu_set_bug_bits(), rdmsrl() is incorrectly passed as its first argument the value of 86_FEATURE_IA32_ARCH_CAPS, which is a CPUID feature bit and not a valid MSR value. The correct parameter to pass in the first argument to rdmsrl() is MSR_IA32_ARCH_CAPABILITIES (0x10a). The value returned by rdmsrl(), specifically the RDCL_NO bit, is later used to determine if the CPU is vulnerable to L1TF and Meltdown exploits. Orabug: 29044805 Signed-off-by: Alejandro Jimenez Reviewed-by: Mihai Carabas Signed-off-by: Brian Maly --- diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 7024a7526b378..43819120a021a 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -864,7 +864,7 @@ static void cpu_set_bug_bits(struct cpuinfo_x86 *c) u64 ia32_cap = 0; if (cpu_has(c, X86_FEATURE_IA32_ARCH_CAPS)) - rdmsrl(X86_FEATURE_IA32_ARCH_CAPS, ia32_cap); + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); if (!x86_match_cpu(cpu_no_spec_store_bypass) && !(ia32_cap & ARCH_CAP_SSB_NO))