ba6e013
From: Borislav Petkov <bp@alien8.de>
ba6e013
Date: Sat, 1 Nov 2014 11:01:00 +0100
ba6e013
Subject: [PATCH] x86, microcode, AMD: Fix early ucode loading on 32-bit
ba6e013
ba6e013
Hi guys,
ba6e013
ba6e013
please queue this for the next batch to Linus.
ba6e013
ba6e013
Thanks.
ba6e013
---
ba6e013
 arch/x86/kernel/cpu/microcode/amd_early.c | 9 +++++++--
ba6e013
 1 file changed, 7 insertions(+), 2 deletions(-)
ba6e013
ba6e013
diff --git a/arch/x86/kernel/cpu/microcode/amd_early.c b/arch/x86/kernel/cpu/microcode/amd_early.c
ba6e013
index 617a9e284245..65bdfb598880 100644
ba6e013
--- a/arch/x86/kernel/cpu/microcode/amd_early.c
ba6e013
+++ b/arch/x86/kernel/cpu/microcode/amd_early.c
ba6e013
@@ -348,6 +348,7 @@ int __init save_microcode_in_initrd_amd(void)
ba6e013
 {
ba6e013
 	unsigned long cont;
ba6e013
 	enum ucode_state ret;
ba6e013
+	u8 *cont_va;
ba6e013
 	u32 eax;
ba6e013
 
ba6e013
 	if (!container)
ba6e013
@@ -355,13 +356,15 @@ int __init save_microcode_in_initrd_amd(void)
ba6e013
 
ba6e013
 #ifdef CONFIG_X86_32
ba6e013
 	get_bsp_sig();
ba6e013
-	cont = (unsigned long)container;
ba6e013
+	cont	= (unsigned long)container;
ba6e013
+	cont_va = __va(container);
ba6e013
 #else
ba6e013
 	/*
ba6e013
 	 * We need the physical address of the container for both bitness since
ba6e013
 	 * boot_params.hdr.ramdisk_image is a physical address.
ba6e013
 	 */
ba6e013
-	cont = __pa(container);
ba6e013
+	cont    = __pa(container);
ba6e013
+	cont_va = container;
ba6e013
 #endif
ba6e013
 
ba6e013
 	/*
ba6e013
@@ -372,6 +375,8 @@ int __init save_microcode_in_initrd_amd(void)
ba6e013
 	if (relocated_ramdisk)
ba6e013
 		container = (u8 *)(__va(relocated_ramdisk) +
ba6e013
 			     (cont - boot_params.hdr.ramdisk_image));
ba6e013
+	else
ba6e013
+		container = cont_va;
ba6e013
 
ba6e013
 	if (ucode_new_rev)
ba6e013
 		pr_info("microcode: updated early to new patch_level=0x%08x\n",
ba6e013
-- 
ba6e013
1.9.3
ba6e013