From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756794Ab2LAA3k (ORCPT ); Fri, 30 Nov 2012 19:29:40 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39205 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993Ab2LAA3i (ORCPT ); Fri, 30 Nov 2012 19:29:38 -0500 Date: Fri, 30 Nov 2012 16:29:27 -0800 From: tip-bot for Fenghua Yu Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, fenghua.yu@intel.com, tglx@linutronix.de, hpa@linux.intel.com Reply-To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, fenghua.yu@intel.com, tglx@linutronix.de, hpa@linux.intel.com In-Reply-To: <1354240068-9821-10-git-send-email-fenghua.yu@intel.com> References: <1354240068-9821-10-git-send-email-fenghua.yu@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/microcode] x86/mm/init.c: Copy ucode from initrd image to memory Git-Commit-ID: 834137534b34b2ef0e1c3c00ad6a31e06b604e00 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (terminus.zytor.com [127.0.0.1]); Fri, 30 Nov 2012 16:29:32 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 834137534b34b2ef0e1c3c00ad6a31e06b604e00 Gitweb: http://git.kernel.org/tip/834137534b34b2ef0e1c3c00ad6a31e06b604e00 Author: Fenghua Yu AuthorDate: Thu, 29 Nov 2012 17:47:47 -0800 Committer: H. Peter Anvin CommitDate: Fri, 30 Nov 2012 15:18:17 -0800 x86/mm/init.c: Copy ucode from initrd image to memory Before initrd image is freed, copy valid ucode patches from initrd image to kernel virtual memory. The saved ucode will be used to update AP in resume. Signed-off-by: Fenghua Yu Link: http://lkml.kernel.org/r/1354240068-9821-10-git-send-email-fenghua.yu@intel.com Signed-off-by: H. Peter Anvin --- 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 d7aea41..a294d4b 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 unsigned long __initdata pgt_buf_start; unsigned long __meminitdata pgt_buf_end; @@ -391,6 +392,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(&mc_saved_data, mc_saved_in_initrd); +#endif + /* * end could be not aligned, and We can not align that, * decompresser could be confused by aligned initrd_end