[Cooker] Re: lkml: Requested FAQ addition - Mandrake and partial-i686platforms

2003-08-21 Thread Juan Quintela
> "gc" == Guillaume Cottenceau <[EMAIL PROTECTED]> writes:

gc> Andrey Borzenkov <[EMAIL PROTECTED]> writes:
>> > Now we need to consider this as it should, e.g. with vanilla
>> > kernel anyway many mandrake additions are missing, but it's still
>> > important and probably should be at least documented.
>> 
>> put it another way - do we need this patch for 2.6? If yes, please, could you 
>> add it to contrib 2.6 RPM?

gc> I'd say yes but I guess Gwenole and/or Juan should rather answer
gc> that one.

without looking at the glibc source, we need it :(

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy



[Cooker] Re: lkml: Requested FAQ addition - Mandrake and partial-i686platforms

2003-08-14 Thread Juan Quintela
> "gc" == Guillaume Cottenceau <[EMAIL PROTECTED]> writes:

gc> Gwenole Beauchesne <[EMAIL PROTECTED]> writes:
>> On Wed, 13 Aug 2003, [koi8-r] "Andrey Borzenkov[koi8-r] "  wrote:
>> 
>> > Thread is quite interesting even if I do not fully understand it :)
>> 
>> There is no CMOV emulator. I simply patched kernel so that it reports VIA 
>> C3 as i586.

gc> They pretend the bug was in the glibc, but you always said it was
gc> kernel who was wrongly reporting C3 as a i686. Who's right?

History is quite long.

short sumary:

glibc is wrong, but fix glibc is very difficult.  It is easier
to workaround problem on kernel.

Long story:

Intel when defined the i686, make cmov instruction optional,
guess why there is a cmov flag in the cpuid flags:

quintela$ grep cmov /proc/cpuinfo 
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat 
pse36 mmx fxsr syscall mmxext 3dnowext 3dnow

All intel CPU's implement cmov (to my knowledge all i686 CPU's except
old Via C3 and I am not sure about Crusoe).  All AMD i686 class cpu
implement cmov.

kernel defines i686 to be the intel definition.

Now come gcc, and gcc defined i686 as the intel implementation (aka
with cmov instruction).  As cmov instruction is very good for the
compiler, gcc people don't want to define i686 without cmov.

Now what is the right definiton?

Obviously, teh most right definition is the kernel one, as that is as
the specification tels.

Now, what is the most useful definition?

Obviously also, the gcc one, as the generate code is better.

How to fix that?

a) kernel tell that i686 only for cpus that have cmov (workaround).
b) ld.so checks architecuter and flags, that works for ld.so, and is a
   better & more elegant solution.  gb told me that there is some
   problem with dlopen().

That is the state of the question as far as I know it.

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy