linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY
@ 2012-09-07  6:48 Jan Beulich
  2012-09-07  7:16 ` H. Peter Anvin
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2012-09-07  6:48 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: linux-kernel

This was quite a bit off: While I never build for anything older than
i686 (other than for specifically trying certain things out), one of my
32-bit configs (tailor made for a VIA system) ended up having this set
to 4. Others, customized for more mainstream systems, had this set to 5.

Once at it, also drop the unnecessary dependencies on X86_32 - that
symbol being the inverse of X86_64, and Kconfig default determination
working by a first match algorithm, X86_64 being dealt with in the very
first selection makes it unnecessary to have that dependency in all
subsequent default selections.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 arch/x86/Kconfig.cpu |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- 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"
 
 config X86_DEBUGCTLMSR




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY
  2012-09-07  6:48 [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY Jan Beulich
@ 2012-09-07  7:16 ` H. Peter Anvin
  2012-09-07  7:31   ` Jan Beulich
  2012-09-07  7:36   ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: H. Peter Anvin @ 2012-09-07  7:16 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, linux-kernel

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.

What a mess.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY
  2012-09-07  7:16 ` H. Peter Anvin
@ 2012-09-07  7:31   ` Jan Beulich
  2012-09-07 15:08     ` H. Peter Anvin
  2012-09-07  7:36   ` Jan Beulich
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2012-09-07  7:31 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: mingo, tglx, linux-kernel

>>> On 07.09.12 at 09:16, "H. Peter Anvin" <hpa@zytor.com> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY
  2012-09-07  7:16 ` H. Peter Anvin
  2012-09-07  7:31   ` Jan Beulich
@ 2012-09-07  7:36   ` Jan Beulich
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2012-09-07  7:36 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: mingo, tglx, linux-kernel

>>> On 07.09.12 at 09:31, Jan Beulich wrote:
>>>> On 07.09.12 at 09:16, "H. Peter Anvin" <hpa@zytor.com> wrote:
> > 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.

Plus perhaps the X86_64 line should then also be changed into
"depends on X86_32", as all cared about features on x86-64 are
CPUID-enumerable.

Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY
  2012-09-07  7:31   ` Jan Beulich
@ 2012-09-07 15:08     ` H. Peter Anvin
  0 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2012-09-07 15:08 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, linux-kernel

On 09/07/2012 12:31 AM, Jan Beulich wrote:
>
> 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.
>

The dependency X86_64 -> X86_P6_NOP is actually not inherent; it is a 
worksaround for a broken version of Microsoft HyperV presenting an 
inconsistent ISA to the guest.  We could allow enabling X86_P6_NOP on 32 
bits, in which family should be 6.

	-hpa


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-07 15:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07  6:48 [PATCH] ix86: improve determination of X86_MINIMUM_CPU_FAMILY Jan Beulich
2012-09-07  7:16 ` H. Peter Anvin
2012-09-07  7:31   ` Jan Beulich
2012-09-07 15:08     ` H. Peter Anvin
2012-09-07  7:36   ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).