Received: by 10.213.65.68 with SMTP id h4csp466402imn; Tue, 13 Mar 2018 09:57:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELvA0BKKG35Gbu7xPwuk7mK719+dKT0N04X11nOl3cGO+d4LNeVTELjRIR21tr1A9wk22g4S X-Received: by 10.99.101.193 with SMTP id z184mr1039958pgb.429.1520960260555; Tue, 13 Mar 2018 09:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520960260; cv=none; d=google.com; s=arc-20160816; b=BxyE/eDJ13fXP5M0h/6/JJXKR69v8PVaqIbc8Fhba4qvFpb8BwXdJhbmrrME/lr7+e bmGHc5lcMsojTCCh3vQoBuQQcmJPgTX1K45S0rZJ4fxrkLesck0gR0/X+Av7BpUdOHSA NktVUR9yaxacUIN8WoJr3FxoVsW9h1PuQvThCF/87RwFekH1RCbTldHlSSQDePEYi+1D r8VOfJf426xTL6ipT/ABZ9ngVz6TJeQrvEpJARGGZ7qDsZJdBs7fU7XDb1vIM7AZilKZ +coB0/FXs7XcRDzaT8+nIiH9UKjZ2ly6tvut0NhSoBLmMTrIDdoshfxboWsxxdAoa5Ro LF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=qsZSHO6EDGzpwmwiYN9OnAtqAFuLzPfYWwBJ606Ha9Q=; b=nb6A/eHlRv8h7pkSuPQVAT2fyrkl8XY10mCf1h8lWdw10+poDLuBQZ8LG2K+zo8tKm YT5ZH+083cCkkS3ycNRbztAAQmCwrxWCIrjy4KWcPXK8JKxm/hjpMqrgfkTEaxa5XGO+ 67sAjZ9dBv7VFusNHtgQCyKP1jpo0hqt3zA0hBexqifTqLcCL7TtNGx/a/pwDNq+v7PY km0evJx9SAq39ntLVPRePvkCTmz1WDQUAfNSCN7I0lBeFsaSPf9DQiEl+cGeOhVFmAH3 ydBTef16fuS/NAWtHiGbRCLRFfNDSdgOwDK19MDEA4pmCfU0MGYV8F/LzfZxDehik+9i ImYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si294334plm.188.2018.03.13.09.57.26; Tue, 13 Mar 2018 09:57:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752491AbeCMPa1 (ORCPT + 99 others); Tue, 13 Mar 2018 11:30:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58794 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932718AbeCMPaZ (ORCPT ); Tue, 13 Mar 2018 11:30:25 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4FD67F8F; Tue, 13 Mar 2018 15:30:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Luck , Borislav Petkov , Thomas Gleixner , Yazen Ghannam , linux-edac Subject: [PATCH 4.15 062/146] x86/MCE: Save microcode revision in machine check records Date: Tue, 13 Mar 2018 16:23:49 +0100 Message-Id: <20180313152325.457100177@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152320.439085687@linuxfoundation.org> References: <20180313152320.439085687@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Luck commit fa94d0c6e0f3431523f5701084d799c77c7d4a4f upstream. Updating microcode used to be relatively rare. Now that it has become more common we should save the microcode version in a machine check record to make sure that those people looking at the error have this important information bundled with the rest of the logged information. [ Borislav: Simplify a bit. ] Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: Yazen Ghannam Cc: linux-edac Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180301233449.24311-1-tony.luck@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/uapi/asm/mce.h | 1 + arch/x86/kernel/cpu/mcheck/mce.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/arch/x86/include/uapi/asm/mce.h +++ b/arch/x86/include/uapi/asm/mce.h @@ -30,6 +30,7 @@ struct mce { __u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */ __u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */ __u64 ppin; /* Protected Processor Inventory Number */ + __u32 microcode;/* Microcode revision */ }; #define MCE_GET_RECORD_LEN _IOR('M', 1, int) --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -131,6 +131,8 @@ void mce_setup(struct mce *m) if (this_cpu_has(X86_FEATURE_INTEL_PPIN)) rdmsrl(MSR_PPIN, m->ppin); + + m->microcode = boot_cpu_data.microcode; } DEFINE_PER_CPU(struct mce, injectm); @@ -263,7 +265,7 @@ static void __print_mce(struct mce *m) */ pr_emerg(HW_ERR "PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x microcode %x\n", m->cpuvendor, m->cpuid, m->time, m->socketid, m->apicid, - cpu_data(m->extcpu).microcode); + m->microcode); } static void print_mce(struct mce *m)