From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH] KVM: X86: Allow userspace to define the microcode version Date: Mon, 26 Feb 2018 11:49:21 +0100 Message-ID: <20180226104921.GA4377@pd.tnic> References: <1519629838-4898-1-git-send-email-wanpengli@tencent.com> <20180226094148.GA15539@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: LKML , kvm , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Feb 26, 2018 at 06:06:42PM +0800, Wanpeng Li wrote: > I think it is the host admin(e.g. cloud provider)'s responsibility to > set an expected microcode revision. + vcpu->arch.microcode_version = 0x1; That already looks pretty arbitrary and non-sensical to me. >In addition, the non-sensical value which is written by the guest will >not reflect to guest-visible microcode revision and just be ignored in >this implementation. Huh? How so? So a guest will have *two* microcode revisions - both of which are most likely wrong?! This whole thing sounds like the wrong approach to me. > Linux (among the others) has checks to make sure that certain features > aren't enabled on a certain family/model/stepping if the microcode version > isn't greater than or equal to a known good version. It sounds to me like the proper fix is to make the kernel *not* look at microcode revisions when running virtualized. The same way we're not loading microcode in a guest: if (native_cpuid_ecx(1) & BIT(31)) Letting userspace control the microcode revision number is revision number management SNAFU waiting to happen IMO. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.