Re: [PATCH] ix86: improve determination ofX86_MINIMUM_CPU_FAMILY

From: Jan Beulich
Date: Fri Sep 07 2012 - 03:31:42 EST


>>> On 07.09.12 at 09:16, "H. Peter Anvin" <hpa@xxxxxxxxx> wrote:
> On 09/06/2012 11:48 PM, Jan Beulich wrote:
>>
>> --- 3.6-rc4/arch/x86/Kconfig.cpu
>> +++ 3.6-rc4-x86-minimum-cpu-family/arch/x86/Kconfig.cpu
>> @@ -409,9 +409,9 @@ config X86_CMOV
>> config X86_MINIMUM_CPU_FAMILY
>> int
>> default "64" if X86_64
>> - default "6" if X86_32 && X86_P6_NOP
>> - default "5" if X86_32 && X86_CMPXCHG64
>> - default "4" if X86_32 && (X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK)
>> + default "6" if X86_P6_NOP || X86_CMOV
>> + default "5" if X86_CMPXCHG64 || X86_TSC
>> + default "4" if X86_XADD || X86_CMPXCHG || X86_BSWAP || X86_WP_WORKS_OK
>> default "3"
>>
>
> Erk, this isn't right either. We're not supposed to include
> CPUID-enumerable features here, so X86_CMOV, X86_CMPXCHG64 and X86_TSC
> don't belong, and should instead be done via required-features.h.

Ah, so I got misguided by there already being a CPUID-detectable
feature here (X86_CMPXCHG64). And by the fact that e.g. having
M686 (or better) selected is then in fact not expected to have a
relationship to the value chosen here (worth a comment perhaps).

Further, the "6" case is then completely pointless - X86_P6_NOP
depends on X86_64. And with all features the kernel cares about
that got added with Pentium and later being CPUID-enumerable,
the "5" case would then be superfluous too.

Jan

Jan

--
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/