Fix microcode change for i386
PATCH 1/1 Fix microcode change for i386
This patch should fix the i386 compile problem in the microcode driver I caused with the IA32e updates.
arch/i386/kernel/microcode.c renamed from arch/i386/kernel/microcode.c-o +2 -2
@@ -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" );
Quoted 3 lines · Andi Kleen
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
Quoted 7 lines · Andi Kleen
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
arch/i386/kernel/microcode.c line 375
Quoted 7 lines
arch/i386/kernel/microcode.c renamed from arch/i386/kernel/microcode.c-o +2
-2@@ -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