]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
UBUNTU: SAUCE: Revert "x86/cpu: Add a helper function x86_read_arch_cap_msr()"
authorConnor Kuehl <connor.kuehl@canonical.com>
Mon, 18 Nov 2019 21:37:03 +0000 (13:37 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 4 Dec 2019 09:29:26 +0000 (10:29 +0100)
BugLink: https://bugs.launchpad.net/bugs/1852338
This reverts commit ada2a6b05f6df9c5af9bc753a49db84a5a46a6ef in favor of
the version from an upstream stable update.

Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/cpu.h

index d3b0d67c924348000261802d672e6f4656a5a2a6..f125bf7ecb6fbca590df390956f53b46d95aec48 100644 (file)
@@ -1091,19 +1091,9 @@ static bool __init cpu_matches(unsigned long which)
        return m && !!(m->driver_data & which);
 }
 
-u64 x86_read_arch_cap_msr(void)
-{
-       u64 ia32_cap = 0;
-
-       if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES))
-               rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap);
-
-       return ia32_cap;
-}
-
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
-       u64 ia32_cap = x86_read_arch_cap_msr();
+       u64 ia32_cap = 0;
 
        if (cpu_matches(NO_SPECULATION))
                return;
@@ -1111,6 +1101,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
        setup_force_cpu_bug(X86_BUG_SPECTRE_V1);
        setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
 
+       if (cpu_has(c, X86_FEATURE_ARCH_CAPABILITIES))
+               rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap);
+
        if (!cpu_matches(NO_SSB) && !(ia32_cap & ARCH_CAP_SSB_NO) &&
           !cpu_has(c, X86_FEATURE_AMD_SSB_NO))
                setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS);
index a5cd0eba27465f81c54a7062f28dfce57fefe85a..c0e2407abdd6ab0342982b795f3deb8a5037d474 100644 (file)
@@ -62,6 +62,4 @@ unsigned int aperfmperf_get_khz(int cpu);
 
 extern void x86_spec_ctrl_setup_ap(void);
 
-extern u64 x86_read_arch_cap_msr(void);
-
 #endif /* ARCH_X86_CPU_H */