diff options
| author | Borislav Petkov <bp@suse.de> | 2016-02-03 06:33:38 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2016-02-09 05:41:17 -0500 |
| commit | 58b5f2cc4bdbc9b616e68639f5a84886aa5be590 (patch) | |
| tree | 07bec71eea3310896bcc6faf04dcdba9b41d01b5 /arch/x86/kernel/cpu/microcode | |
| parent | de778275c295825e6638f3f74103f40642d45caa (diff) | |
x86/microcode/intel: Move the BUG_ON up and turn it into WARN_ON
If we're going to BUG_ON() because we're running on the wrong CPU, we
better do it as the first thing we do when entering that function. And
also, turn it into a WARN_ON() because it is not worth to panic the
system if we apply the microcode on the wrong CPU - we're simply going
to exit early.
Tested-by: Thomas Voegtle <tv@lio96.de>
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/1454499225-21544-11-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu/microcode')
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index d1b2f583f543..c029c2bb2a29 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c | |||
| @@ -843,12 +843,12 @@ static int apply_microcode_intel(int cpu) | |||
| 843 | int cpu_num = raw_smp_processor_id(); | 843 | int cpu_num = raw_smp_processor_id(); |
| 844 | struct cpuinfo_x86 *c = &cpu_data(cpu_num); | 844 | struct cpuinfo_x86 *c = &cpu_data(cpu_num); |
| 845 | 845 | ||
| 846 | uci = ucode_cpu_info + cpu; | ||
| 847 | mc = uci->mc; | ||
| 848 | |||
| 849 | /* We should bind the task to the CPU */ | 846 | /* We should bind the task to the CPU */ |
| 850 | BUG_ON(cpu_num != cpu); | 847 | if (WARN_ON(cpu_num != cpu)) |
| 848 | return -1; | ||
| 851 | 849 | ||
| 850 | uci = ucode_cpu_info + cpu; | ||
| 851 | mc = uci->mc; | ||
| 852 | if (!mc) | 852 | if (!mc) |
| 853 | return 0; | 853 | return 0; |
| 854 | 854 | ||
