Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbcL1T1x (ORCPT ); Wed, 28 Dec 2016 14:27:53 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:34676 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933AbcL1T1v (ORCPT ); Wed, 28 Dec 2016 14:27:51 -0500 Subject: Re: [PATCH 3/2] x86/microcode/intel: Add a helper which gives the microcode revision To: Borislav Petkov , Junichi Nomura References: <2f771739-a617-0870-2f68-2a8ebba0bc46@ce.jp.nec.com> <20161228111830.GA21788@nazgul.tnic> <20161228112120.GC21788@nazgul.tnic> <20161228125354.GA30537@nazgul.tnic> Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Andy Lutomirski , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" From: Boris Ostrovsky Message-ID: Date: Wed, 28 Dec 2016 14:26:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161228125354.GA30537@nazgul.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 869 Lines: 24 On 12/28/2016 07:53 AM, Borislav Petkov wrote: > On Wed, Dec 28, 2016 at 12:21:20PM +0100, Borislav Petkov wrote: >> From: Borislav Petkov >> >> Intel supplies the microcode revision value in MSR 0x8b >> (IA32_BIOS_SIGN_ID) after CPUID(1) has been executed. Execute it each >> time before reading that MSR. > > And then, we can go a step further and even do a separate helper which does the > required steps to read out the microcode revision so that we don't forget them > next time we change the code. > > Provided that works for xen, though, because I need to do the native > variants but early_init_intel() can call the paravirt *msr() versions > and I have no idea whether that's kosher on xen pv. > > Boris, any objections? I think this should work. MSR_IA32_UCODE_REV can be natively read and written with zero without any side effects. -boris