]> Git Repo - J-linux.git/commitdiff
x86/cpu: Use MSR_IA32_MISC_ENABLE constants
authorPaolo Bonzini <[email protected]>
Tue, 19 Jul 2022 17:47:14 +0000 (13:47 -0400)
committerBorislav Petkov <[email protected]>
Tue, 19 Jul 2022 18:53:10 +0000 (20:53 +0200)
Instead of the magic numbers 1<<11 and 1<<12 use the constants
from msr-index.h.  This makes it obvious where those bits
of MSR_IA32_MISC_ENABLE are consumed (and in fact that Linux
consumes them at all) to simple minds that grep for
MSR_IA32_MISC_ENABLE_.*_UNAVAIL.

Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/x86/kernel/cpu/intel.c

index 8321c43554a1d2e2cb615b4f9d6af463eb0f082f..a00dd3e2ab558d66cf72df411dce32b9ec328dec 100644 (file)
@@ -647,9 +647,9 @@ static void init_intel(struct cpuinfo_x86 *c)
                unsigned int l1, l2;
 
                rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
-               if (!(l1 & (1<<11)))
+               if (!(l1 & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL))
                        set_cpu_cap(c, X86_FEATURE_BTS);
-               if (!(l1 & (1<<12)))
+               if (!(l1 & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL))
                        set_cpu_cap(c, X86_FEATURE_PEBS);
        }
 
This page took 0.050666 seconds and 4 git commands to generate.