Re: cpuid_eax damages registers (2.4.7pre7)

From: Linus Torvalds (
Date: Wed Jul 18 2001 - 10:10:22 EST

In article <Pine.LNX.4.10.10107181347030.16710-100000@l> you write:
> I don't know whether cpuid_eax (2.4.7pre) should preserve the
>registers changed from cpuid

It should. It has the proper "this instruction assigned values to these
registers" stuff, so gcc should know which ones change.

> but I have an oops on boot with 2.4.7pre7 in
>squash_the_stupid_serial_number where cpuid_eax changes ebx and the
>parameter "c" is loaded with "Genu". The following change fixes the

Interesting. Can you do the following:

 - tell us your compiler version

 - do a "make arch/i386/kernel/setup.s" both ways, and show what
   squash_the_stupid_serial_number() looks like.

 - fix _all_ the "cpuid*()" functions to have

        :"0" (op)

   instead of their current incorrect

        :"a" (op)

   (we're supposed to explicitly tell the compiler that the first input
   is the same as the first output)

 - see if that makes any difference to the assembler output.

In any case it does sound like a compiler bug, but it would be good to
have a workaround. But it would also be good to have a more complete
dump of the oops in question to see more about what is going on..

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jul 23 2001 - 21:00:10 EST