Re: [PATCH 3/4] x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros

From: Thomas Gleixner
Date: Sat Dec 05 2015 - 13:51:09 EST


On Tue, 1 Dec 2015, Borislav Petkov wrote:
> #if __GNUC__ >= 4
> extern void warn_pre_alternatives(void);
> diff --git a/arch/x86/include/asm/xor_32.h b/arch/x86/include/asm/xor_32.h
> index 5a08bc8bff33..ccca77dad474 100644
> --- a/arch/x86/include/asm/xor_32.h
> +++ b/arch/x86/include/asm/xor_32.h
> @@ -553,7 +553,7 @@ do { \
> if (cpu_has_xmm) { \
> xor_speed(&xor_block_pIII_sse); \
> xor_speed(&xor_block_sse_pf64); \
> - } else if (cpu_has_mmx) { \
> + } else if (static_cpu_has_safe(X86_FEATURE_MMX)) { \

This one can be boot_cpu_has. It's only used in crypto init for
testing the fastest xor algo.

> diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
> index 3b533cf37c74..8f2ef910c7bf 100644
> --- a/arch/x86/kernel/cpu/mtrr/generic.c
> +++ b/arch/x86/kernel/cpu/mtrr/generic.c
> @@ -349,7 +349,7 @@ static void get_fixed_ranges(mtrr_type *frs)
>
> void mtrr_save_fixed_ranges(void *info)
> {
> - if (cpu_has_mtrr)
> + if (static_cpu_has_safe(X86_FEATURE_MTRR))
> get_fixed_ranges(mtrr_state.fixed_ranges);

This one is not really hotpath either. Its called from cpu_up and from
hibernation code.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/