Received: by 10.223.176.5 with SMTP id f5csp1839161wra; Wed, 31 Jan 2018 12:24:47 -0800 (PST) X-Google-Smtp-Source: AH8x2255Lit8WBt1M6lXQz007wLYeDnBci7z1RHsmBgw+GaolBxBYeqUxJFvrjwbXU5fejgaWvM7 X-Received: by 10.99.127.24 with SMTP id a24mr27164035pgd.225.1517430287817; Wed, 31 Jan 2018 12:24:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517430287; cv=none; d=google.com; s=arc-20160816; b=eOTXppEmDKhRO7do8+TBgWuBvNaJY4tB68OG6yzWMHSNlIzN41LIt6Rx13wA39C/Pb RGtLEgpqjisxsa6ZmYpJQp0UH67xz32sFlKlh9I58AUMTp82DgIZlYkLo6IAJgr3KS21 spsXSPAKiHxjPw2eVy8Sa2nUG5yj9KsG9RoZIt7p8Mm9B5tVBhv31Et9k7OCmyhY9OZ2 +2i2C/XJFuOymSi6y4VjgFXVVm4MrUBZr4oQu/REP8+WXFcqY2KF93uwVMZdTLMcqgYm 3IsD/D226oVHEsi8b+4S+1tAyzWbbayjIOkTzWkS8GTpUZ8js87mBKVWBCHmZa6od+8w 8jqg== 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:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature:arc-authentication-results; bh=Z+rFset/4JqOB9b7TLgRUg775qaM+6d99N+vxRzDtJ4=; b=vNPjgTDlhhzCsmvDog2CG/c+17UIZg6paal5CJpQzbIxZ4O2zTczUc43Tar+qyG9kC Kad5Cx4GOJasufj/3WVYwjGqMVi2SH0BbiHWxCHmINZFBAkHUa5jYQCob40CsWJD30qv 2YRIXcxmcfx6XffiJL2jyyYxY0ez/JdO5ByHMapouhv+N+yqIS7rYivEzdpNYQ0DO36v fbPfIHGdgXIpU96ZaOjg96Tcco6OgRWSHp6y+T75iUA2Wwg30/9RmPPILCeV+mjXrOt1 GxE4hYkOO4euzegdtaV8L1q6MXxvM4BMQzf7RH7281slUAjF3ppN08qieTfQJoabcv23 CAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=gNWEDJOn; 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 g14-v6si4282089plj.292.2018.01.31.12.24.33; Wed, 31 Jan 2018 12:24:47 -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=gNWEDJOn; 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 S1752766AbeAaUXV (ORCPT + 99 others); Wed, 31 Jan 2018 15:23:21 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47944 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbeAaUXS (ORCPT ); Wed, 31 Jan 2018 15:23:18 -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 w0VKHIiZ032019; Wed, 31 Jan 2018 20:22:53 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 : content-transfer-encoding; s=corp-2017-10-26; bh=Z+rFset/4JqOB9b7TLgRUg775qaM+6d99N+vxRzDtJ4=; b=gNWEDJOnLb+2ZxK5iOcMpVJkonL8HW2kETYljrTF/UOZ+Gx3Zq0AGo8fPlqORWjuC4xJ 7xGGMGK6AVaHvSAtxXbApXuwYbFtH8TqsKdytazOy6lvDhx2I5qvumHPT0CL8TkRSykn csvQ5qZHhvTMyK6sA0EQ3QrJ+4iXZhkDonfR93/lSB7lTMiUyTzSs7ycuv1vq3Uz6XMz x1tIF7QzFuVApSgcw4fWqNjOcHE2+6WbYZpoD9iGxwTooIwuFxU06Jax/Cq5PjlFpNvo YckoG+hNXKr1MR6ICLf94sFkP28CkmYhhlx9Pcn3fXaZVTZwWx6PrTcUtVU9Ox6ckaA3 SA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2fujpm8muk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2018 20:22:53 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0VKMqZ3023067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2018 20:22:52 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0VKMqsp013143; Wed, 31 Jan 2018 20:22:52 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Jan 2018 12:22:51 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id A57476A09F6; Wed, 31 Jan 2018 15:22:50 -0500 (EST) Date: Wed, 31 Jan 2018 15:22:50 -0500 From: Konrad Rzeszutek Wilk To: KarimAllah Ahmed Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , David Woodhouse Subject: Re: [PATCH v5 1/5] KVM: x86: Update the reverse_cpuid list to include CPUID_7_EDX Message-ID: <20180131202250.GF22045@char.us.oracle.com> References: <1517427467-28567-1-git-send-email-karahmed@amazon.de> <1517427467-28567-2-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1517427467-28567-2-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.8.3 (2017-05-23) Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8791 signatures=668659 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310253 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 08:37:43PM +0100, KarimAllah Ahmed wrote: > [dwmw2: Stop using KF() for bits in it, too] > Cc: Paolo Bonzini > Cc: Radim Kr=C4=8Dm=C3=A1=C5=99 > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: H. Peter Anvin > Cc: x86@kernel.org > Cc: kvm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Reviewed-by: Paolo Bonzini Reviewed-by: Konrad Rzeszutek Wilk > Signed-off-by: KarimAllah Ahmed > Signed-off-by: David Woodhouse > --- > arch/x86/kvm/cpuid.c | 8 +++----- > arch/x86/kvm/cpuid.h | 1 + > 2 files changed, 4 insertions(+), 5 deletions(-) >=20 > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index 0099e10..c0eb337 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -67,9 +67,7 @@ u64 kvm_supported_xcr0(void) > =20 > #define F(x) bit(X86_FEATURE_##x) > =20 > -/* These are scattered features in cpufeatures.h. */ > -#define KVM_CPUID_BIT_AVX512_4VNNIW 2 > -#define KVM_CPUID_BIT_AVX512_4FMAPS 3 > +/* For scattered features from cpufeatures.h; we currently expose none= */ > #define KF(x) bit(KVM_CPUID_BIT_##x) > =20 > int kvm_update_cpuid(struct kvm_vcpu *vcpu) > @@ -392,7 +390,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_e= ntry2 *entry, u32 function, > =20 > /* cpuid 7.0.edx*/ > const u32 kvm_cpuid_7_0_edx_x86_features =3D > - KF(AVX512_4VNNIW) | KF(AVX512_4FMAPS); > + F(AVX512_4VNNIW) | F(AVX512_4FMAPS); > =20 > /* all calls to cpuid_count() should be made on the same cpu */ > get_cpu(); > @@ -477,7 +475,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_e= ntry2 *entry, u32 function, > if (!tdp_enabled || !boot_cpu_has(X86_FEATURE_OSPKE)) > entry->ecx &=3D ~F(PKU); > entry->edx &=3D kvm_cpuid_7_0_edx_x86_features; > - entry->edx &=3D get_scattered_cpuid_leaf(7, 0, CPUID_EDX); > + cpuid_mask(&entry->edx, CPUID_7_EDX); > } else { > entry->ebx =3D 0; > entry->ecx =3D 0; > diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h > index c2cea66..9a327d5 100644 > --- a/arch/x86/kvm/cpuid.h > +++ b/arch/x86/kvm/cpuid.h > @@ -54,6 +54,7 @@ static const struct cpuid_reg reverse_cpuid[] =3D { > [CPUID_8000_000A_EDX] =3D {0x8000000a, 0, CPUID_EDX}, > [CPUID_7_ECX] =3D { 7, 0, CPUID_ECX}, > [CPUID_8000_0007_EBX] =3D {0x80000007, 0, CPUID_EBX}, > + [CPUID_7_EDX] =3D { 7, 0, CPUID_EDX}, > }; > =20 > static __always_inline struct cpuid_reg x86_feature_cpuid(unsigned x86= _feature) > --=20 > 2.7.4 >=20