From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752576AbcFIX6m (ORCPT ); Thu, 9 Jun 2016 19:58:42 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:37786 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbcFIX6l (ORCPT ); Thu, 9 Jun 2016 19:58:41 -0400 X-Sasl-enc: coQbKFUuBlRz8yzo8QHWbt+/1rAeaL2orvrMT+KCHU+1 1465516719 Date: Thu, 9 Jun 2016 20:58:36 -0300 From: Henrique de Moraes Holschuh To: Andi Kleen Cc: x86@kernel.org, elliott@hpe.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH] x86/microcode/intel: Quieten down microcode updates on large systems Message-ID: <20160609235836.GC30888@khazad-dum.debian.net> References: <20160609134141.5981-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160609134141.5981-1-andi@firstfloor.org> X-GPG-Fingerprint1: 4096R/39CB4807 C467 A717 507B BAFE D3C1 6092 0BD9 E811 39CB 4807 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 09 Jun 2016, Andi Kleen wrote: > From: Andi Kleen > > On large systems the microcode driver is very noisy, because it prints > a line for each CPU. The lines are redundant because 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. > > v2: Change message to "One or more CPUs" > Signed-off-by: Andi Kleen Thanks, for WLIW, Reviewed-by: Henrique de Moraes Holschuh > --- > arch/x86/kernel/cpu/microcode/intel.c | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c > index cbb3cf0..54f5f6c 100644 > --- a/arch/x86/kernel/cpu/microcode/intel.c > +++ b/arch/x86/kernel/cpu/microcode/intel.c > @@ -794,6 +794,7 @@ void reload_ucode_intel(void) > > static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) > { > + static struct cpu_signature prev; > struct cpuinfo_x86 *c = &cpu_data(cpu_num); > unsigned int val[2]; > > @@ -808,8 +809,14 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) > } > > csig->rev = c->microcode; > - pr_info("CPU%d sig=0x%x, pf=0x%x, revision=0x%x\n", > - cpu_num, csig->sig, csig->pf, csig->rev); > + > + /* No extra locking on prev, races are harmless. */ > + if (csig->sig != prev.sig || csig->pf != prev.pf || > + csig->rev != prev.rev) { > + pr_info("One or more CPUs sig=0x%x, pf=0x%x, revision=0x%x\n", > + csig->sig, csig->pf, csig->rev); > + prev = *csig; > + } > > return 0; > } > @@ -838,6 +845,7 @@ static int apply_microcode_intel(int cpu) > struct ucode_cpu_info *uci; > struct cpuinfo_x86 *c; > unsigned int val[2]; > + static int prev_rev; > > /* We should bind the task to the CPU */ > if (WARN_ON(raw_smp_processor_id() != cpu)) > @@ -872,11 +880,14 @@ static int apply_microcode_intel(int cpu) > return -1; > } > > - pr_info("CPU%d updated to revision 0x%x, date = %04x-%02x-%02x\n", > - cpu, val[1], > - mc->hdr.date & 0xffff, > - mc->hdr.date >> 24, > - (mc->hdr.date >> 16) & 0xff); > + if (val[1] != prev_rev) { > + pr_info("One or more CPUs updated to revision 0x%x, date = %04x-%02x-%02x\n", > + val[1], > + mc->hdr.date & 0xffff, > + mc->hdr.date >> 24, > + (mc->hdr.date >> 16) & 0xff); > + prev_rev = val[1]; > + } > > c = &cpu_data(cpu); > -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh