All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: X86 ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 9/9] Documentation/microcode: Document some aspects for more clarity
Date: Mon,  6 Jun 2016 17:10:50 +0200	[thread overview]
Message-ID: <1465225850-7352-10-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1465225850-7352-1-git-send-email-bp@alien8.de>

From: Borislav Petkov <bp@suse.de>

Document that builtin microcode is 64-bit only. Also, improve/add
comments to places.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: linux-doc@vger.kernel.org
---
 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 c956d99cf1de..07749e7f3d50 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 359e2034b558..8962d6acee39 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -40,9 +40,13 @@
 #include <asm/msr.h>
 
 /*
- * 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;
-- 
2.7.3

  parent reply	other threads:[~2016-06-06 15:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 15:10 [PATCH 0/9] x86/microcode: Fixes for builtin vs initrd loading; cleanups Borislav Petkov
2016-06-06 15:10 ` [PATCH 1/9] x86/microcode: Fix loading precedence Borislav Petkov
2016-06-08  9:51   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 2/9] x86/microcode: Fix suspend to RAM with builtin microcode Borislav Petkov
2016-06-08  9:52   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 3/9] lib/cpio: Make find_cpio_data()'s offset arg optional Borislav Petkov
2016-06-08  9:52   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 4/9] x86/microcode: Get rid of find_cpio_data()'s dummy offset arg Borislav Petkov
2016-06-08  9:53   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 5/9] x86/microcode: Propagate save_microcode_in_initrd() retval Borislav Petkov
2016-06-08  9:53   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 6/9] x86/microcode/intel: Rename load_microcode_early() to find_microcode_patch() Borislav Petkov
2016-06-08  9:54   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 7/9] x86/microcode/intel: Unexport save_mc_for_early() Borislav Petkov
2016-06-08  9:54   ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2016-06-06 15:10 ` [PATCH 8/9] x86/microcode/AMD: Make amd_ucode_patch static Borislav Petkov
2016-06-08  9:55   ` [tip:x86/microcode] x86/microcode/AMD: Make amd_ucode_patch[] static tip-bot for Borislav Petkov
2016-06-06 15:10 ` Borislav Petkov [this message]
2016-06-08  9:55   ` [tip:x86/microcode] Documentation/microcode: Document some aspects for more clarity tip-bot for Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465225850-7352-10-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.