Received: by 10.223.185.116 with SMTP id b49csp4194084wrg; Mon, 26 Feb 2018 12:58:07 -0800 (PST) X-Google-Smtp-Source: AH8x224WzT8EGALpQuiSG6rDsnzixN18SujIbrWirW7a9O5GGrc69aUFKe9hg/ChoYGaZW6RPLI0 X-Received: by 10.167.128.194 with SMTP id a2mr11989764pfn.186.1519678687330; Mon, 26 Feb 2018 12:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678687; cv=none; d=google.com; s=arc-20160816; b=MAY1jADwRgy+CZ1ZOhFdW32Vre5sBke86OQR28wcxH9qxMKceE/cUkhekOTtU3r0zT spUNFuJoCMFBS0x3v7ojVGvJovNt8JNiGID8JXnnXHsLPM9frr6l9yKAGsBrsqHNB6Zw Hig5IrEYywKNVvtAFXWJ/lLLM9YyO1wEYK9Ef93jb/gyd2h28xTZKvSobya1HfgioWHp Y2oP4FVIshHMxjIc/DSDe+Jbgw60Q+ZpifudDT03oKykC9chF2fchtKSndJW2vK0PpEl ptCFH344WW6OlXvggciPSNfaF0NiMkv3yiOLqMPpCXGqIpM3S1JTKLTpG9hDUZ4YfQQA e6NQ== 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:dkim-signature:arc-authentication-results; bh=baRIKy0MwMP+YUKSAKVqUZ4sT91zImoWuE0fFe3kbcw=; b=RwMFFlGx6K8qsKWY0C7nficWPu5Q1Ygq+RUHoQNCKyhHVdpVMfQvYiVC7yc1yhHnu9 mddnL32p2UdOpmq9SDAaGQTQjajajSEbAkJPLDuH9ssTq7rhuNDvtS9faZwQ7dhSBe1I CIPSi0QaY1LhDzHQU9OsH7yHk7j5IVfKq0zAOfd7a9MU7kZ8KcGInTnL7i41nukgO7EE IQ+0kV6msdU9LqmYmVTUhfB2THVbK3D8nbYoumi3y2bT8PJ2s8z3M27YplAdHqQ6XDDR 7H0HU16PkJLeRcD8tpNTmg7ngQy2A5SYkA7nKBxbL0pc/M6mEwDU2oG1B/ilykNeF2uo mGrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=OeM7cUxl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11-v6si369509pls.66.2018.02.26.12.57.51; Mon, 26 Feb 2018 12:58:07 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=OeM7cUxl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752716AbeBZU4o (ORCPT + 99 others); Mon, 26 Feb 2018 15:56:44 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:57918 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751654AbeBZU4k (ORCPT ); Mon, 26 Feb 2018 15:56:40 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1QKuRte136672; Mon, 26 Feb 2018 20:56:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=baRIKy0MwMP+YUKSAKVqUZ4sT91zImoWuE0fFe3kbcw=; b=OeM7cUxlX73ywMB2SvTX3P/S9IWt+DP23lvRTw1fiTSiF57Gv+Fy8WTske85y3AIRGnU CSftmFI7jtgq4tAOTRBN5RU5sH/T+p0yAFT0miyyvEy0mXYOu0WLcL3J/XwaqncrxOOy 10fJP5rTNHrYcWMTOlqG0REry6GY9WrDBm3/MyLh9aV52r6JRJZpYGCmtHrfguN1l4t2 HMe981w8QLj3N4hDl+VOqLS97zrydesUPomLEHxbUXvdOES6h8OBWK0iaUSwPKwHbMPC cFS27gTk3BVznAWRideXbLw2JoXlGj61L+XmiJaASkgfeG7Zs1lYILbQviL0InrqA16Y xw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2gcs2n87ff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Feb 2018 20:56:32 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1QKpVFY003880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 26 Feb 2018 20:51:31 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1QKpViv013664; Mon, 26 Feb 2018 20:51:31 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 26 Feb 2018 12:51:31 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id 64DA86A09E6; Mon, 26 Feb 2018 15:51:30 -0500 (EST) Date: Mon, 26 Feb 2018 15:51:30 -0500 From: Konrad Rzeszutek Wilk To: Borislav Petkov 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: <20180226205130.GZ22024@char.us.oracle.com> References: <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> <20180226193711.GS4377@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180226193711.GS4377@pd.tnic> User-Agent: Mutt/1.8.3 (2017-05-23) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8816 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=872 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802260262 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 08:37:11PM +0100, Borislav Petkov wrote: > 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. Ah yes. Let me fix it up and repost.