From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433Ab2LUOsw (ORCPT ); Fri, 21 Dec 2012 09:48:52 -0500 Received: from mga03.intel.com ([143.182.124.21]:45293 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203Ab2LUOrH (ORCPT ); Fri, 21 Dec 2012 09:47:07 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,329,1355126400"; d="scan'208";a="235197575" From: "Fenghua Yu" To: "H Peter Anvin" , "Ingo Molnar" , "Thomas Gleixner" , "Asit K Mallick" , "Tigran Aivazian" , "Yinghai Lu" , "Andreas Herrmann" , "Borislav Petkov" , "linux-kernel" , "x86" Cc: "Fenghua Yu" Subject: [PATCH v5 11/12] x86/mm/init.c: Copy ucode from initrd image to kernel memory Date: Thu, 20 Dec 2012 23:44:31 -0800 Message-Id: <1356075872-3054-12-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 1.7.2 In-Reply-To: <1356075872-3054-1-git-send-email-fenghua.yu@intel.com> References: <1356075872-3054-1-git-send-email-fenghua.yu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fenghua Yu 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 --- arch/x86/mm/init.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 5f59473..36bad16 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -16,6 +16,7 @@ #include #include #include /* for MAX_DMA_PFN */ +#include #include "mm_internal.h" @@ -555,6 +556,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 -- 1.8.0.1