OSDN Git Service

x86/microcode/intel: Save pointer to ucode patch for early AP loading
authorBorislav Petkov <bp@suse.de>
Wed, 14 Jun 2017 14:06:26 +0000 (16:06 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 20 Jun 2017 10:54:25 +0000 (12:54 +0200)
commitbd20733045d5db55515442d828376a3a71d6be48
tree5a87a5b4ce370035f9656b52f922f367961b3b62
parenta3d98c9358e3be28282ff60dcca01dbc9f402f30
x86/microcode/intel: Save pointer to ucode patch for early AP loading

Normally, when the initrd is gone, we can't search it for microcode
blobs to apply anymore. For that we need to stash away the patch in our
own storage.

And save_microcode_in_initrd_intel() looks like the proper place to
do that from. So in order for early loading to work, invalidate the
intel_ucode_patch pointer to the patch *before* scanning the initrd one
last time.

If the scanning code finds a microcode patch, it will assign that
pointer again, this time with our own storage's address.

This way, early microcode application during resume-from-RAM works too,
even after the initrd is long gone.

Tested-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170614140626.4462-2-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/microcode/intel.c