Received: by 10.213.65.68 with SMTP id h4csp426233imn; Tue, 13 Mar 2018 08:41:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELsH7E/0ThJ8PKMrZY90BVnLTt1gFzp/ucT0vXER/nLTjKSWCRT8Tf9gRu/CftmwyJis5ka+ X-Received: by 2002:a17:902:5609:: with SMTP id h9-v6mr971422pli.302.1520955704387; Tue, 13 Mar 2018 08:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520955704; cv=none; d=google.com; s=arc-20160816; b=S0UXvKrGZN1J9MrAW7LIb6lNgIJtoHFKrdGbTa/3IvfBdq+7XKbjd1x4buOqQh3JcN 2R8FQGeMn0uxco5vSHKigf5ZRrbzK6KC0XXqFWcTXRHH5H7FFGGjxuJ9dqNDqye0oFe8 2Grjeo+mlL2sQ5dBV/at1++n88eeob27WPhaYhwdLqcPBucr4k81fj5w+Z++nWG6EL0/ YYdu0xf0AFFQ45gKQX972xa6ef6qfbhFIR9ZSEsh07aDn65upcmdIczjQpDRTekUW95A tTKzCB+h54uSzqm6aGbwiBaWm6aKqZrW6JrkvWtn6pYj4Wl9RuPWXZtK4MovshD/l5yO nkdg== 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=oIv8HMfPf4qQ3jNd9URjgwsUlFVDkAG9jbkQXazshwY=; b=a6v+TyUoAQLd3KZKdLhRzIzD3R+KaoBkdi1z0DGw0iDAXnCQmoK4EMmVu/xg2igPXy 5+6eDuQrP4HgPQtgZpf/YA9IzE8+0UgVPdvOQGuCk33skvNBKuG8dUaY26nEVktJu51y R6lwnKJYtwh5klO3nSlymkEaJgoNxu4w1T+H2Pk4uljuuRzNhjqHZa1JieXiN+n6QjMX ywXXNqnoO33M9O34brn6ZDN4NItz6zsEgplgTdknapQX5ASY/nYxDG1weVN5mZ86zA0+ pluv8pR9dFPHX3KLO0Z7zzOKqx5d3y6p9EK37hgq/ZWBe8TURWnad4E+TzY7uOkcc3Iw rNeA== 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 b3si257000pga.503.2018.03.13.08.41.28; Tue, 13 Mar 2018 08:41:44 -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 S934775AbeCMPjk (ORCPT + 99 others); Tue, 13 Mar 2018 11:39:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35380 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934742AbeCMPjg (ORCPT ); Tue, 13 Mar 2018 11:39:36 -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 82887FD0; Tue, 13 Mar 2018 15:39:35 +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.14 097/140] x86/MCE: Save microcode revision in machine check records Date: Tue, 13 Mar 2018 16:25:00 +0100 Message-Id: <20180313152504.677367862@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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.14-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)