]> Pileus Git - ~andy/linux/commitdiff
x86/mm/init.c: Copy ucode from initrd image to kernel memory
authorFenghua Yu <fenghua.yu@intel.com>
Fri, 21 Dec 2012 07:44:31 +0000 (23:44 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 31 Jan 2013 21:20:26 +0000 (13:20 -0800)
Before initrd image is freed, copy valid ucode patches from initrd image
to kernel memory. The saved ucode will be used to update AP in resume
or hotplug.

Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: http://lkml.kernel.org/r/1356075872-3054-12-git-send-email-fenghua.yu@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/mm/init.c

index d41815265a0b250d35e1d03834d14439faa4e679..4903a03ae876338c2ad351f5db5988f35bb35d08 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/tlb.h>
 #include <asm/proto.h>
 #include <asm/dma.h>           /* for MAX_DMA_PFN */
+#include <asm/microcode.h>
 
 #include "mm_internal.h"
 
@@ -534,6 +535,15 @@ void free_initmem(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 void __init free_initrd_mem(unsigned long start, unsigned long end)
 {
+#ifdef CONFIG_MICROCODE_EARLY
+       /*
+        * Remember, initrd memory may contain microcode or other useful things.
+        * Before we lose initrd mem, we need to find a place to hold them
+        * now that normal virtual memory is enabled.
+        */
+       save_microcode_in_initrd();
+#endif
+
        /*
         * end could be not aligned, and We can not align that,
         * decompresser could be confused by aligned initrd_end