]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/speculation: Fix bad argument to rdmsrl() in cpu_set_bug_bits()
authorAlejandro Jimenez <alejandro.j.jimenez@oracle.com>
Wed, 12 Dec 2018 02:09:34 +0000 (21:09 -0500)
committerBrian Maly <brian.maly@oracle.com>
Mon, 17 Dec 2018 23:55:48 +0000 (18:55 -0500)
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 <alejandro.j.jimenez@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/kernel/cpu/common.c

index 7024a7526b37885c095505571bb83571328149f3..43819120a021aaa9a6d668732a7e1ebe2efd5b93 100644 (file)
@@ -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))