x86/microcode/intel: Add a helper which gives the microcode revision
authorBorislav Petkov <bp@suse.de>
Mon, 9 Jan 2017 11:41:45 +0000 (12:41 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 May 2019 17:19:33 +0000 (19:19 +0200)
commit2678bc5cef4007463d75ff4ddc35b86aa3fb04ed
tree0441583fd62b0c7b720ac84d2aba6704f8f42244
parenta7501dca303c95e15a1ecc8830729b264081ca1a
x86/microcode/intel: Add a helper which gives the microcode revision

commit 4167709bbf826512a52ebd6aafda2be104adaec9 upstream.

Since on Intel we're required to do CPUID(1) first, before reading
the microcode revision MSR, let's add a special helper which does the
required steps so that we don't forget to do them next time, when we
want to read the microcode revision.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/20170109114147.5082-4-bp@alien8.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[bwh: Backported to 4.9:
 - Keep using sync_core(), which will alway includes the necessary CPUID
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/microcode_intel.h
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/microcode/intel.c