Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941878AbcJ1Jrc (ORCPT ); Fri, 28 Oct 2016 05:47:32 -0400 Received: from mga01.intel.com ([192.55.52.88]:12776 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936169AbcJ1Jr3 (ORCPT ); Fri, 28 Oct 2016 05:47:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,557,1473145200"; d="scan'208";a="24757448" Date: Fri, 28 Oct 2016 17:46:45 +0800 From: He Chen To: Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Luwei Kang , Piotr Luc Subject: Re: [PATCH] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest Message-ID: <20161028094645.GA8148@he> References: <1477645960-6898-1-git-send-email-he.chen@linux.intel.com> <98097397-f1a5-c0b0-0620-31d07b715272@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98097397-f1a5-c0b0-0620-31d07b715272@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1299 Lines: 37 On Fri, Oct 28, 2016 at 11:31:05AM +0200, Paolo Bonzini wrote: > > > On 28/10/2016 11:12, He Chen wrote: > > The spec can be found in Intel Software Developer Manual or in > > Instruction Set Extensions Programming Reference. > > > > Signed-off-by: Luwei Kang > > Signed-off-by: He Chen > > --- > > arch/x86/kvm/cpuid.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > > index afa7bbb..328b169 100644 > > --- a/arch/x86/kvm/cpuid.c > > +++ b/arch/x86/kvm/cpuid.c > > @@ -376,6 +376,10 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, > > /* cpuid 7.0.ecx*/ > > const u32 kvm_cpuid_7_0_ecx_x86_features = F(PKU) | 0 /*OSPKE*/; > > > > + /* cpuid 7.0.edx*/ > > + const u32 kvm_cpuid_7_0_edx_x86_features = > > + 0x4 /* AVX512-4VNNIW */ | 0x8 /* AVX512-4FMAPS */; > > Please define the new features in cpufeature.h first. > These 2 new features defined as scattered features in kernel. In cpufeature.h, there are: #define X86_FEATURE_AVX512_4VNNIW (7*32+16) #define X86_FEATURE_AVX512_4FMAPS (7*32+17) Please see disscusion here: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1250183.html Thanks, -He