From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754247AbcFHJ4k (ORCPT ); Wed, 8 Jun 2016 05:56:40 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56454 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393AbcFHJ4f (ORCPT ); Wed, 8 Jun 2016 05:56:35 -0400 Date: Wed, 8 Jun 2016 02:55:32 -0700 From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, brgerst@gmail.com, dvlasenk@redhat.com, torvalds@linux-foundation.org, bp@alien8.de, luto@amacapital.net, hpa@zytor.com, peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, brgerst@gmail.com, bp@suse.de, luto@amacapital.net, hpa@zytor.com, torvalds@linux-foundation.org, bp@alien8.de, dvlasenk@redhat.com In-Reply-To: <1465225850-7352-10-git-send-email-bp@alien8.de> References: <1465225850-7352-10-git-send-email-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/microcode] Documentation/microcode: Document some aspects for more clarity Git-Commit-ID: 9f3cc2a0772d7744d1d7195d39ac4794af622fe6 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 9f3cc2a0772d7744d1d7195d39ac4794af622fe6 Gitweb: http://git.kernel.org/tip/9f3cc2a0772d7744d1d7195d39ac4794af622fe6 Author: Borislav Petkov AuthorDate: Mon, 6 Jun 2016 17:10:50 +0200 Committer: Ingo Molnar CommitDate: Wed, 8 Jun 2016 11:04:20 +0200 Documentation/microcode: Document some aspects for more clarity Document that builtin microcode is 64-bit only. Also, improve/add comments to places. Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-doc@vger.kernel.org Link: http://lkml.kernel.org/r/1465225850-7352-10-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar --- Documentation/x86/early-microcode.txt | 5 ++++- arch/x86/kernel/cpu/microcode/intel.c | 16 +++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/x86/early-microcode.txt b/Documentation/x86/early-microcode.txt index c956d99..07749e7 100644 --- a/Documentation/x86/early-microcode.txt +++ b/Documentation/x86/early-microcode.txt @@ -45,7 +45,10 @@ Builtin microcode ================= We can also load builtin microcode supplied through the regular firmware -builtin method CONFIG_FIRMWARE_IN_KERNEL. Here's an example: +builtin method CONFIG_FIRMWARE_IN_KERNEL. Only 64-bit is currently +supported. + +Here's an example: CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_EXTRA_FIRMWARE="intel-ucode/06-3a-09 amd-ucode/microcode_amd_fam15h.bin" diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index 359e203..8962d6a 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -40,9 +40,13 @@ #include /* - * Temporary microcode blobs pointers storage. We note here the pointers to - * microcode blobs we've got from whatever storage (detached initrd, builtin). - * Later on, we put those into final storage mc_saved_data.mc_saved. + * Temporary microcode blobs pointers storage. We note here during early load + * the pointers to microcode blobs we've got from whatever storage (detached + * initrd, builtin). Later on, we put those into final storage + * mc_saved_data.mc_saved. + * + * Important: those are offsets from the beginning of initrd or absolute + * addresses within the kernel image when built-in. */ static unsigned long mc_tmp_ptrs[MAX_UCODE_COUNT]; @@ -57,6 +61,7 @@ static struct ucode_blobs { bool valid; } blobs; +/* Go through saved patches and find the one suitable for the current CPU. */ static enum ucode_state find_microcode_patch(struct microcode_intel **saved, unsigned int num_saved, struct ucode_cpu_info *uci) @@ -466,6 +471,7 @@ static void show_saved_mc(void) static void save_mc_for_early(u8 *mc) { #ifdef CONFIG_HOTPLUG_CPU + /* Synchronization during CPU hotplug. */ static DEFINE_MUTEX(x86_cpu_microcode_mutex); struct microcode_intel *mc_saved_tmp[MAX_UCODE_COUNT]; @@ -474,10 +480,6 @@ static void save_mc_for_early(u8 *mc) struct microcode_intel **mc_saved; int ret, i; - /* - * Hold hotplug lock so mc_saved_data is not accessed by a CPU in - * hotplug. - */ mutex_lock(&x86_cpu_microcode_mutex); mc_saved_count_init = mc_saved_data.num_saved;