* Re: [PATCH] Fix microcode change for i386
2004-02-19 0:11 [PATCH] Fix microcode change for i386 Andi Kleen
@ 2004-02-18 23:29 ` Linus Torvalds
2004-02-19 5:16 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Linus Torvalds @ 2004-02-18 23:29 UTC (permalink / raw)
To: Andi Kleen; +Cc: linux-kernel
On Thu, 19 Feb 2004, Andi Kleen wrote:
>
> This patch should fix the i386 compile problem in the microcode driver I caused with
> the IA32e updates.
I doubt it. Doing a ">>32" on an "unsigned long" on x86 should give you a
warning about undefined behaviour.
See the patch I posted, which should be safe, afaik.
Linus
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Fix microcode change for i386
@ 2004-02-19 0:11 Andi Kleen
2004-02-18 23:29 ` Linus Torvalds
2004-02-19 5:16 ` Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Andi Kleen @ 2004-02-19 0:11 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
This patch should fix the i386 compile problem in the microcode driver I caused with
the IA32e updates.
diff -u linux-2.6.3-amd64/arch/i386/kernel/microcode.c-o linux-2.6.3-amd64/arch/i386/kernel/microcode.c
--- linux-2.6.3-amd64/arch/i386/kernel/microcode.c-o 2004-02-19 00:19:32.000000000 +0100
+++ linux-2.6.3-amd64/arch/i386/kernel/microcode.c 2004-02-19 00:56:41.000000000 +0100
@@ -371,8 +371,8 @@
spin_lock_irqsave(µcode_update_lock, flags);
/* write microcode via MSR 0x79 */
- wrmsr(MSR_IA32_UCODE_WRITE, (u64)(uci->mc->bits),
- (u64)(uci->mc->bits) >> 32);
+ wrmsr(MSR_IA32_UCODE_WRITE, (u32)(unsigned long)(uci->mc->bits),
+ (u32)(((unsigned long)uci->mc->bits) >> 32));
wrmsr(MSR_IA32_UCODE_REV, 0, 0);
__asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx");
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix microcode change for i386
2004-02-19 0:11 [PATCH] Fix microcode change for i386 Andi Kleen
2004-02-18 23:29 ` Linus Torvalds
@ 2004-02-19 5:16 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2004-02-19 5:16 UTC (permalink / raw)
To: Andi Kleen; +Cc: torvalds, linux-kernel
Andi Kleen wrote:
> This patch should fix the i386 compile problem in the microcode driver I caused with
> the IA32e updates.
>
> diff -u linux-2.6.3-amd64/arch/i386/kernel/microcode.c-o linux-2.6.3-amd64/arch/i386/kernel/microcode.c
> --- linux-2.6.3-amd64/arch/i386/kernel/microcode.c-o 2004-02-19 00:19:32.000000000 +0100
> +++ linux-2.6.3-amd64/arch/i386/kernel/microcode.c 2004-02-19 00:56:41.000000000 +0100
> @@ -371,8 +371,8 @@
> spin_lock_irqsave(µcode_update_lock, flags);
>
> /* write microcode via MSR 0x79 */
> - wrmsr(MSR_IA32_UCODE_WRITE, (u64)(uci->mc->bits),
> - (u64)(uci->mc->bits) >> 32);
> + wrmsr(MSR_IA32_UCODE_WRITE, (u32)(unsigned long)(uci->mc->bits),
> + (u32)(((unsigned long)uci->mc->bits) >> 32));
You still want to do two 16-bit shifts instead of a single 32-bit shift.
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-02-19 5:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 0:11 [PATCH] Fix microcode change for i386 Andi Kleen
2004-02-18 23:29 ` Linus Torvalds
2004-02-19 5:16 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox