Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp23992imm; Tue, 3 Jul 2018 13:09:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeATbPowTv3cEehNaDvVm/plz1BIuUJ76VUjOQ58LpuKh+r1oj6toCbOFXxXw0XwSwJvPPj X-Received: by 2002:a65:6258:: with SMTP id q24-v6mr14739070pgv.131.1530648580662; Tue, 03 Jul 2018 13:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530648580; cv=none; d=google.com; s=arc-20160816; b=g52aBf52/DWSWMacvtG5rje33OWXKbT4jxYKDn4QqWkzO1+YzsrXUmwHYdLEaCmG0x L++HA5zJxO7u7ALvS8TpO1lIGeXdaUjiVs6MiBBY863Fs6XuB6V1NPsZgyvb6uqnEbuM e56JfojMmiybL3Sf8VDP4mNEhjOrM649nvsa3HYsRujIt3EhFPxCREdr3QIqw051IepF Z0C4CJOtzTOMNs2zABfgxStm3lg/YaoTc8XVFXy3ytfX+omLxnkzHd3qfOvWZQ0TOu03 PKceM0eYCYSI4v7/UXkVERGpd9N+6G2JrVE0QaxzruNrZTsA6w2adiIksX9qQAlpqcyN CP8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=2bmgKFaDJbHXNNMkS/Fzy5cHeuU5wRMbePlVsKUIeNU=; b=PVZMWnxMMfUGEKyOHq9kF93wgVo9Sa0XJqK2GFUo0b/AAKuFBkttmQVKIGe66EGXou /05LRNXQsASwksbprMsURDwNN/KZECZn1Ove/Vy/fMyWzqeut2waaOSsHHONzXd1LNJE dwaglZRJywcEC6doSut0/J+VA+f/SCB7GW88JX7Xy1v7VP4OjO8frIK9CyZexKQiWnuy Azv2OYKjOtYqdHiyWhmk2aRdXZfOGAifJyyyurH0lzRKsO8xYIY4emAqAOIGjvjQ5TPc JO/qlWxBTRTsFwbmNRA/9k68XYmwcehE7qas5G1meDwwD+IJK3jvxKgNrpFxD/a2fEr5 4Ndg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si1704416plr.410.2018.07.03.13.09.23; Tue, 03 Jul 2018 13:09: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753013AbeGCUIn (ORCPT + 99 others); Tue, 3 Jul 2018 16:08:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35362 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752292AbeGCUIm (ORCPT ); Tue, 3 Jul 2018 16:08:42 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F440BB43B; Tue, 3 Jul 2018 20:08:41 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39F3A2156889; Tue, 3 Jul 2018 20:08:41 +0000 (UTC) Subject: Re: [PATCH] x86/MCE: Fix CPU microcode version output To: "Luck, Tony" Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-edac@vger.kernel.org References: <20180703164844.9742-1-prarit@redhat.com> <20180703165849.GA17773@agluck-desk> From: Prarit Bhargava Message-ID: <5ed43b85-a92f-8d6c-4565-d2e88d6d3f08@redhat.com> Date: Tue, 3 Jul 2018 16:08:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180703165849.GA17773@agluck-desk> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Jul 2018 20:08:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Jul 2018 20:08:41 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'prarit@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/03/2018 12:58 PM, Luck, Tony wrote: > On Tue, Jul 03, 2018 at 12:48:44PM -0400, Prarit Bhargava wrote: >> On systems where a runtime microcode update has occurred the >> microcode version is wrong because boot_cpu_data.microcode is >> not updated during runtime. >> >> Use the per-CPU microcode version in the MCE message. > > Other option would be to fix the microcode update code to make > sure that boot_cpu_data.microcode is right. I thought about that too [1] but TBH I've always been a bit confused by boot_cpu_data vs. cpu_data(). At one point I thought that boot_cpu_data is valid only up to a specific point in boot and from that point on the cpu_data() should be used but I'm no longer sure if that's correct. If that is not correct when should boot_cpu_data be used vs cpu_data()? Is boot_cpu_data truly supposed to represent the general state of the boot cpu at boot time? Look at the same function mce_setup() that I modified in my patch. There is another reference to boot_cpu_data.x86_vendor (which obviously will never change during runtime) that likely should be cpu_data() if my understanding above is correct. P. [1] Since the kernel now uses a cpu rendezvous model to update the microcode it would be trivial to set boot_cpu_data.microcode to the new value. > > But if we go this route we should add: > > Fixes: fa94d0c6e0f3 ("x86/MCE: Save microcode revision in machine check records") > Cc: stable@vger.kernel.org > > Can also get a: > > Reviewed-by: Tony Luck > > -Tony Luck >