From 3b5a9edcb2153d9a9530dcd50b5eb2f844faef5d Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 2 May 2012 16:41:55 -0700 Subject: Fix register corruption during Intel Microcode update Another bug in the Intel microcode update code that existed since we switched to LinuxBIOSv2 in 2004: The inline assembly code that reads the CPU revision from an MSR after running cpuid(1) trashes registers EBX and ECX. Only ECX was mentioned in the clobber list. C code running after this function could silently access completely wrong data, which resulted in the wrong date being printed on microcode updates (and potentially other issues happening until the C code writes to EBX again) Change-Id: Ida733fa1747565ec9824d3a37d08b1a73cd8355f Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/996 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/cpu/intel/microcode/microcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cpu/intel') diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c index ae1c26a4b5..ec42fb91d7 100644 --- a/src/cpu/intel/microcode/microcode.c +++ b/src/cpu/intel/microcode/microcode.c @@ -63,7 +63,7 @@ static inline u32 read_microcode_rev(void) "=a" (msr.lo), "=d" (msr.hi) : /* inputs */ : /* trashed */ - "ecx" + "ebx", "ecx" ); return msr.hi; } -- cgit v1.2.3