Skip to content

Commit 3f2adf0

Browse files
bonzinisuryasaimadhu
authored andcommitted
x86/cpu: Use MSR_IA32_MISC_ENABLE constants
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 <pbonzini@redhat.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lore.kernel.org/r/20220719174714.2410374-1-pbonzini@redhat.com
1 parent 6f33a9d commit 3f2adf0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kernel/cpu/intel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ static void init_intel(struct cpuinfo_x86 *c)
647647
unsigned int l1, l2;
648648

649649
rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
650-
if (!(l1 & (1<<11)))
650+
if (!(l1 & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL))
651651
set_cpu_cap(c, X86_FEATURE_BTS);
652-
if (!(l1 & (1<<12)))
652+
if (!(l1 & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL))
653653
set_cpu_cap(c, X86_FEATURE_PEBS);
654654
}
655655

0 commit comments

Comments
 (0)