OSDN Git Service

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>
Thu, 16 May 2019 17:45:07 +0000 (19:45 +0200)
commit98cc1464cfd6edf9dc7fa96aaaf596aae952029b
tree6f3f52c16692345e80cedcbf649637e23b3bb863
parent5ec6421c21c6818c91509672c3f1c8b2e8bdb78d
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.4:
 - Don't touch prev_rev variable in apply_microcode()
 - 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