Received: by 10.223.185.116 with SMTP id b49csp4127305wrg; Mon, 26 Feb 2018 11:38:42 -0800 (PST) X-Google-Smtp-Source: AG47ELspEEKuj7XQmechsPWtg/gszOVLfIw4jpPrvToMDrVzai762kAzIJbhE3+mi8HgNd3W5Jpx X-Received: by 2002:a17:902:bd41:: with SMTP id b1-v6mr4673111plx.147.1519673921907; Mon, 26 Feb 2018 11:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519673921; cv=none; d=google.com; s=arc-20160816; b=GtAGmtGX6OIErNhFaAeFmlwxL2Wc4EUv0p+/e5oTRpUp81ahllv3KCumvr54tm/P8j hJzaUVe1+oo66nph1XhmBcKKvTFRK6bYfze0teGbi8oK3vJ1uITfYg/l2+xrvL1Nagd7 sZ8Xp7kFBd8D5hWL/rjfUl3942+zcqFN/9aGJb/cYYn5MMZSp+Hkqe+EqIFy9Imb3+W0 ngglvYEn5Ato1nTS0J4QmZ3jCb72AnofX+dKZ1nBDRYvL/Do9Vz09NtK0nsGVkdfFrU6 +3Llw1GMV0kINfmXC/pKoxBYYtTChQAOp0SXM4UxSqoYcFSsQFMKnoMtg2jboA55hHYJ mglQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=pBR9UUpSGh7EdIpT/HYM+o1b3WyJ5S/paB4wohJCx/s=; b=ea4ELhGfSDcAWi661uOlGPbwK4YgMy2unApHOriqHMN95feP/TLCUR4wC9KQoECdEc OiRANXYr+msGgHpZA39wLPUIlIghFOO/4lORjXt30uADWcsDtXQxBYHFAgvulsyL4m0A f7vUyalj4vDhMuvTuHdBKmIVdu6r6Q0lL2/SlmQFK1D8lko09b3SVm0KW7rKyfbkbEAK hU4Ns1hNwejfnpXsFvWoH2ATxW6dV/cl9AERGPXYLGOMs4CVHPY2Kj0a0dqMlWSc2+ot EYQF1qpfjzjBD/vNN+JxQtBd9ItHpThsyCZhvS0Z3Pf6Rw8vPBHuGVnIZdWFbim6FpRO GZDA== 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 x7si428538pgo.122.2018.02.26.11.38.25; Mon, 26 Feb 2018 11:38:41 -0800 (PST) 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 S1751779AbeBZThe (ORCPT + 99 others); Mon, 26 Feb 2018 14:37:34 -0500 Received: from mail.skyhub.de ([5.9.137.197]:45650 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbeBZThd (ORCPT ); Mon, 26 Feb 2018 14:37:33 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id n4yUfB2_wthh; Mon, 26 Feb 2018 20:37:31 +0100 (CET) Received: from pd.tnic (p200300EC2BCE210020411134B639594E.dip0.t-ipconnect.de [IPv6:2003:ec:2bce:2100:2041:1134:b639:594e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 73C0A1EC020A; Mon, 26 Feb 2018 20:37:31 +0100 (CET) Date: Mon, 26 Feb 2018 20:37:11 +0100 From: Borislav Petkov To: Konrad Rzeszutek Wilk Cc: Paolo Bonzini , Wanpeng Li , LKML , kvm , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: X86: Allow userspace to define the microcode version Message-ID: <20180226193711.GS4377@pd.tnic> References: <20180226113000.GC4377@pd.tnic> <20180226114409.GD4377@pd.tnic> <46cecef2-b0fb-b0c2-bbf3-983328d52763@redhat.com> <20180226121509.GE4377@pd.tnic> <24cd527d-5287-f0be-ffe8-eab341bf1d94@redhat.com> <3866d359-0ef8-6a99-6254-84890be62b93@redhat.com> <20180226122205.GG4377@pd.tnic> <20180226143912.GC22024@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180226143912.GC22024@char.us.oracle.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 26, 2018 at 09:39:12AM -0500, Konrad Rzeszutek Wilk wrote: > diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c > index d19e903214b4..87d044ce837f 100644 > --- a/arch/x86/kernel/cpu/intel.c > +++ b/arch/x86/kernel/cpu/intel.c > @@ -144,6 +144,13 @@ static bool bad_spectre_microcode(struct cpuinfo_x86 *c) > { > int i; > > + /* > + * We know that the hypervisor lie to us on the microcode version so > + * we may as well trust that it is running the correct version. > + */ > + if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) I guess cpu_has(c, X86_FEATURE_HYPERVISOR) since we're passing a ptr to the current CPU. It boils down to the same thing in the end but this is bit nicer and besides the rest of the code uses cpu_has() too. Otherwise, yap, this looks like a good idea. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.