diff options
author | Borislav Petkov <bp@suse.de> | 2018-02-16 06:26:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-17 02:43:55 -0500 |
commit | 3f1f576a195aa266813cbd4ca70291deb61e0129 (patch) | |
tree | 56e3bda481e5dbffec0625eb96e768cbf56ae5fd /arch/x86/kernel/cpu/microcode/intel.c | |
parent | eb6174f6d1be16b19cfa43dac296bfed003ce1a6 (diff) |
x86/microcode: Propagate return value from updating functions
... so that callers can know when microcode was updated and act
accordingly.
Tested-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
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/20180216112640.11554-2-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/intel.c')
-rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index a15db2b4e0d6..923054a6b760 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c | |||
@@ -772,7 +772,7 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) | |||
772 | return 0; | 772 | return 0; |
773 | } | 773 | } |
774 | 774 | ||
775 | static int apply_microcode_intel(int cpu) | 775 | static enum ucode_state apply_microcode_intel(int cpu) |
776 | { | 776 | { |
777 | struct microcode_intel *mc; | 777 | struct microcode_intel *mc; |
778 | struct ucode_cpu_info *uci; | 778 | struct ucode_cpu_info *uci; |
@@ -782,7 +782,7 @@ static int apply_microcode_intel(int cpu) | |||
782 | 782 | ||
783 | /* We should bind the task to the CPU */ | 783 | /* We should bind the task to the CPU */ |
784 | if (WARN_ON(raw_smp_processor_id() != cpu)) | 784 | if (WARN_ON(raw_smp_processor_id() != cpu)) |
785 | return -1; | 785 | return UCODE_ERROR; |
786 | 786 | ||
787 | uci = ucode_cpu_info + cpu; | 787 | uci = ucode_cpu_info + cpu; |
788 | mc = uci->mc; | 788 | mc = uci->mc; |
@@ -790,7 +790,7 @@ static int apply_microcode_intel(int cpu) | |||
790 | /* Look for a newer patch in our cache: */ | 790 | /* Look for a newer patch in our cache: */ |
791 | mc = find_patch(uci); | 791 | mc = find_patch(uci); |
792 | if (!mc) | 792 | if (!mc) |
793 | return 0; | 793 | return UCODE_NFOUND; |
794 | } | 794 | } |
795 | 795 | ||
796 | /* write microcode via MSR 0x79 */ | 796 | /* write microcode via MSR 0x79 */ |
@@ -801,7 +801,7 @@ static int apply_microcode_intel(int cpu) | |||
801 | if (rev != mc->hdr.rev) { | 801 | if (rev != mc->hdr.rev) { |
802 | pr_err("CPU%d update to revision 0x%x failed\n", | 802 | pr_err("CPU%d update to revision 0x%x failed\n", |
803 | cpu, mc->hdr.rev); | 803 | cpu, mc->hdr.rev); |
804 | return -1; | 804 | return UCODE_ERROR; |
805 | } | 805 | } |
806 | 806 | ||
807 | if (rev != prev_rev) { | 807 | if (rev != prev_rev) { |
@@ -818,7 +818,7 @@ static int apply_microcode_intel(int cpu) | |||
818 | uci->cpu_sig.rev = rev; | 818 | uci->cpu_sig.rev = rev; |
819 | c->microcode = rev; | 819 | c->microcode = rev; |
820 | 820 | ||
821 | return 0; | 821 | return UCODE_UPDATED; |
822 | } | 822 | } |
823 | 823 | ||
824 | static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size, | 824 | static enum ucode_state generic_load_microcode(int cpu, void *data, size_t size, |