[git pull] x86 fixes - Kernel
This is a discussion on [git pull] x86 fixes - Kernel ; On Mon, Sep 08, 2008 at 11:04:30AM -0700, Linus Torvalds wrote:
>
>
> On Mon, 8 Sep 2008, H. Peter Anvin wrote:
> >
> > config X86_GENERIC
> > - bool "Generic x86 support"
> > + bool ...
-
Re: [git pull] x86 fixes
On Mon, Sep 08, 2008 at 11:04:30AM -0700, Linus Torvalds wrote:
>
>
> On Mon, 8 Sep 2008, H. Peter Anvin wrote:
> >
> > config X86_GENERIC
> > - bool "Generic x86 support"
> > + bool "Generic x86 support" if EMBEDDED
>
> Ok, so after having realized that this seems to be more about a bug with
> gcc, I'm really not as convinced any more.
>
> As far as I can tell, there are three issues:
>
> - "-mtune=core/core2/pentium4/.." is buggy in some gas/gcc versions on
> x86-32, and makes architectural choices.
>
> Any actual _released_ versions? Maybe it's just a current SVN issue?
>
> Workaround: don't use it. And yes, X86_GENERIC=y will do that, although
> quite frankly that seems to be dubious in itself.
>...
As far as I understood it it's a gas issue, and X86_GENERIC=y would
therefore *not* fix the bug with gcc < 4.2 and affected binutils
since we pass -mtune=i686 for gcc < 4.2 with X86_GENERIC=y.
Anything I miss?
> Linus
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Adrian Bunk wrote:
>
> As far as I understood it it's a gas issue, and X86_GENERIC=y would
> therefore *not* fix the bug with gcc < 4.2 and affected binutils
> since we pass -mtune=i686 for gcc < 4.2 with X86_GENERIC=y.
>
> Anything I miss?
>
Well, for one thing, gcc doesn't actually pass the -mtune= option to
gas, it turns out.
But yes, "-Wa,-march=generic32" is really the proper fix.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Andi Kleen wrote:
> Krzysztof Halasa writes:
>
>> Linus Torvalds writes:
>>
>>> - "modern 32-bit": PPro and better. Can take CMOV, MMX and TSC for
>>> granted.
>> VIA C3 (Samuel 2/Ezra, 600 - 1000 MHz?, common on VIA EPIA-*: home
>> theatres etc) can't CMOV.
>
> AFAIK they fixed that in newer BIOS with a microcode update. It's
> slow, but it works.
>
Yes, but if it's slower than jmp+mov than you actively want to avoid it.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Andi Kleen wrote:
> Krzysztof Halasa writes:
>
>> Linus Torvalds writes:
>>
>>> - "modern 32-bit": PPro and better. Can take CMOV, MMX and TSC for
>>> granted.
>> VIA C3 (Samuel 2/Ezra, 600 - 1000 MHz?, common on VIA EPIA-*: home
>> theatres etc) can't CMOV.
>
> AFAIK they fixed that in newer BIOS with a microcode update. It's
> slow, but it works.
...
Our firewall here uses a Via C3-600 CPU, and CMOV has never worked on it.
But based upon your posting, I have today upgraded the BIOS to the
latest (2004) version.
Now.. how can I check whether CMOV works or not? It's not listed in /proc/cpuinfo.
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Mark Lord wrote:
>
> Now.. how can I check whether CMOV works or not? It's not listed in
> /proc/cpuinfo.
>
Compile just about any C program with -march=i686.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
On Tue, Sep 09, 2008 at 10:03:53AM -0700, H. Peter Anvin wrote:
> Adrian Bunk wrote:
>>
>> As far as I understood it it's a gas issue, and X86_GENERIC=y would
>> therefore *not* fix the bug with gcc < 4.2 and affected binutils
>> since we pass -mtune=i686 for gcc < 4.2 with X86_GENERIC=y.
>>
>> Anything I miss?
>
> Well, for one thing, gcc doesn't actually pass the -mtune= option to
> gas, it turns out.
What caused gas to emit the "wrong" NOPs?
> But yes, "-Wa,-march=generic32" is really the proper fix.
If I understand the binutils changelog correctly -march=generic32
support was added one week before the NOP code in question, so all
affected binutils versions support it.
> -hpa
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Mark Lord wrote:
> Andi Kleen wrote:
>> Krzysztof Halasa writes:
>>
>>> Linus Torvalds writes:
>>>
>>>> - "modern 32-bit": PPro and better. Can take CMOV, MMX and TSC for
>>>> granted.
>>> VIA C3 (Samuel 2/Ezra, 600 - 1000 MHz?, common on VIA EPIA-*: home
>>> theatres etc) can't CMOV.
>>
>> AFAIK they fixed that in newer BIOS with a microcode update. It's
>> slow, but it works.
> ..
>
> Our firewall here uses a Via C3-600 CPU, and CMOV has never worked on it.
> But based upon your posting, I have today upgraded the BIOS to the
> latest (2004) version.
>
> Now.. how can I check whether CMOV works or not? It's not listed in
> /proc/cpuinfo.
...
H. Peter Anvin wrote:
>
> Compile just about any C program with -march=i686.
...
Okay, done. And the binary does indeed have a ton of CMOV instructions.
When running it, this appears immediately:
Illegal instruction
So much for the "BIOS upgrade fixes CMOV microcode" theory.
Cheers
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
Adrian Bunk wrote:
>> Well, for one thing, gcc doesn't actually pass the -mtune= option to
>> gas, it turns out.
>
> What caused gas to emit the "wrong" NOPs?
It doesn't, after all, with the current gcc driver. A future gcc driver
may change that. Of course, now when this has popped up on the radar
screen, it might not happen.
>> But yes, "-Wa,-march=generic32" is really the proper fix.
>
> If I understand the binutils changelog correctly -march=generic32
> support was added one week before the NOP code in question, so all
> affected binutils versions support it.
s/-march/-mtune/, but yes. I suspect it was actually added *in order*
to support the NOP code.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [git pull] x86 fixes
> Our firewall here uses a Via C3-600 CPU, and CMOV has never worked on it.
> But based upon your posting, I have today upgraded the BIOS to the
> latest (2004) version.
That's probably not new enough.
>
> Now.. how can I check whether CMOV works or not? It's not listed in
> /proc/cpuinfo.
If it's not in cpuinfo it won't work.
-Andi
--
ak@linux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/