Skip to content

Commit 354542d

Browse files
Andi KleenIngo Molnar
authored andcommitted
x86/microcode/intel: Do not issue microcode updates messages on each CPU
On large systems the microcode driver is very noisy, because it prints a line for each CPU. The lines are redundant because usually all CPUs are updated to the same microcode revision. All other subsystems have been patched previously to not print a line for each CPU. Only the microcode driver is left. Only print an microcode revision update when something changed. This results in typically only a single line being printed. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: elliott@hpe.com Cc: hmh@hmh.eng.br Link: http://lkml.kernel.org/r/20160609134141.5981-1-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9f3cc2a commit 354542d

File tree

1 file changed

+17
-7
lines changed
  • arch/x86/kernel/cpu/microcode

1 file changed

+17
-7
lines changed

arch/x86/kernel/cpu/microcode/intel.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ void reload_ucode_intel(void)
843843

844844
static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
845845
{
846+
static struct cpu_signature prev;
846847
struct cpuinfo_x86 *c = &cpu_data(cpu_num);
847848
unsigned int val[2];
848849

@@ -857,8 +858,13 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
857858
}
858859

859860
csig->rev = c->microcode;
860-
pr_info("CPU%d sig=0x%x, pf=0x%x, revision=0x%x\n",
861-
cpu_num, csig->sig, csig->pf, csig->rev);
861+
862+
/* No extra locking on prev, races are harmless. */
863+
if (csig->sig != prev.sig || csig->pf != prev.pf || csig->rev != prev.rev) {
864+
pr_info("sig=0x%x, pf=0x%x, revision=0x%x\n",
865+
csig->sig, csig->pf, csig->rev);
866+
prev = *csig;
867+
}
862868

863869
return 0;
864870
}
@@ -887,6 +893,7 @@ static int apply_microcode_intel(int cpu)
887893
struct ucode_cpu_info *uci;
888894
struct cpuinfo_x86 *c;
889895
unsigned int val[2];
896+
static int prev_rev;
890897

891898
/* We should bind the task to the CPU */
892899
if (WARN_ON(raw_smp_processor_id() != cpu))
@@ -921,11 +928,14 @@ static int apply_microcode_intel(int cpu)
921928
return -1;
922929
}
923930

924-
pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n",
925-
cpu, val[1],
926-
mc->hdr.date & 0xffff,
927-
mc->hdr.date >> 24,
928-
(mc->hdr.date >> 16) & 0xff);
931+
if (val[1] != prev_rev) {
932+
pr_info("updated to revision 0x%x, date = %04x-%02x-%02x\n",
933+
val[1],
934+
mc->hdr.date & 0xffff,
935+
mc->hdr.date >> 24,
936+
(mc->hdr.date >> 16) & 0xff);
937+
prev_rev = val[1];
938+
}
929939

930940
c = &cpu_data(cpu);
931941

0 commit comments

Comments
 (0)