Skip to contentSkip to conversation

Fix date output in x86 microcode driver.

PATCH Applied David Woodhouse 2 participants 2 messages Aug 12, 2008 – Aug 13, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix date output in x86 microcode driver.

The microcode stores its date in a uint32_t in some weird order approximating pdp-endian. Rather than printing it like that, print it properly in ISO standard form.

arch/x86/kernel/microcode.c +3 -2
index 652fa5c..394fbdd 100644
@@ -343,8 +343,9 @@ static void apply_microcode(int cpu)
 		return;
 	}
 	printk(KERN_INFO "microcode: CPU%d updated from revision "
-	       "0x%x to 0x%x, date = %08x \n",
-	       cpu_num, uci->rev, val[1], uci->mc->hdr.date);
+	       "0x%x to 0x%x, date = %04x-%02x-%02x \n",
+	       cpu_num, uci->rev, val[1], uci->mc->hdr.date & 0xffff,
+	       uci->mc->hdr.date >> 24, (uci->mc->hdr.date >> 16) & 0xff);
 	uci->rev = val[1];
 }
 
Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
Applied
#1 lore raw
Quoted 3 lines · David Woodhouse

The microcode stores its date in a uint32_t in some weird order approximating pdp-endian. Rather than printing it like that, print it properly in ISO standard form.

applied to tip/x86/microcode - thanks David.

Note that i did some manual merging because microcode support changed a few details meanwhile, due to the addition of the AMD microcode driver. Find the commit below.

Ingo

--------------->

Quoted 1 line

From 34a1b9fc4995102ecbb3a980b348aebf168d8196 Mon Sep 17 00:00:00 2001

From: David Woodhouse <[email protected]>
Date: Tue, 12 Aug 2008 13:25:44 +0100
Subject: [PATCH] Fix date output in x86 microcode driver.

The microcode stores its date in a uint32_t in some weird order approximating pdp-endian. Rather than printing it like that, print it properly in ISO standard form.

---
 arch/x86/kernel/microcode_intel.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
arch/x86/kernel/microcode_intel.c +5 -2
index a61986e..d2d9d74 100644
@@ -339,8 +339,11 @@ static void apply_microcode(int cpu)
 		return;
 	}
 	printk(KERN_INFO "microcode: CPU%d updated from revision "
-	       "0x%x to 0x%x, date = %08x \n",
-	       cpu_num, uci->rev, val[1], uci->mc.mc_intel->hdr.date);
+	       "0x%x to 0x%x, date = %04x-%02x-%02x \n",
+		cpu_num, uci->rev, val[1],
+		uci->mc.mc_intel->hdr.date & 0xffff,
+		uci->mc.mc_intel->hdr.date >> 24,
+		(uci->mc.mc_intel->hdr.date >> 16) & 0xff);
 	uci->rev = val[1];
 }