Re: kernel/microcode.c error from new 64bit code

From: Linus Torvalds
Date: Wed Feb 18 2004 - 18:24:59 EST




On Wed, 18 Feb 2004, Linus Torvalds wrote:
>
> How about this patch?

Btw, it does show a bug in our "wrmsr()" macro on x86.

We should make sure to cast the values to 32-bit values in wrmsr(), or use
an inline function to make sure that the right conversions happen. Because
we arguably shouldn't give some meaningless error message just because we
passed in a 64-bit argument.

So in addition to fixing "microcode.c" to not do the silly thing in the
first place, we should probably clean up wrmsr().

I'll think about it. In one sense it was _useful_ to see that the
microcode update tried to do something that was nonsensical on a 32-bit
x86. On the other hand, the compiler should do the right thing regardless,
and it might be useful to allow 64-bit values to be silently truncated
for compatibility reasons.

I'll commit the microcode fix, and think a bit more about the wrmsr()
thing.

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