From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765830AbcJaKa4 (ORCPT ); Mon, 31 Oct 2016 06:30:56 -0400 Received: from mail.skyhub.de ([78.46.96.112]:61000 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765788AbcJaKaz (ORCPT ); Mon, 31 Oct 2016 06:30:55 -0400 Date: Mon, 31 Oct 2016 11:30:50 +0100 From: Borislav Petkov To: "Luc, Piotr" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "he.chen@linux.intel.com" , "tglx@linutronix.de" , "x86@kernel.org" , "hpa@zytor.com" , "mingo@redhat.com" , "pbonzini@redhat.com" , "Kang, Luwei" , "rkrcmar@redhat.com" Subject: Re: [PATCH] x86/cpuid: expose AVX512_4VNNIW and AVX512_4FMAPS features to kvm guest Message-ID: <20161031103050.k7b2l64blhmv33mw@pd.tnic> References: <1477645960-6898-1-git-send-email-he.chen@linux.intel.com> <1477649272.17668.7.camel@intel.com> <5c00fdf0-a5a4-7a78-4ed8-8ae3ef710a68@redhat.com> <20161028110834.svzzs5hftg3bybiz@pd.tnic> <20161028122123.24i3synevehn6r3p@pd.tnic> <425702906.9319122.1477743677017.JavaMail.zimbra@redhat.com> <1477905033.32008.5.camel@intel.com> <20161031095312.dzv3rj2fqgjjsy7w@pd.tnic> <1477908811.32008.20.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1477908811.32008.20.camel@intel.com> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2016 at 10:18:41AM +0000, Luc, Piotr wrote: > The cpuid_mask function, which usually used in kvm, read bit from this > x86_capabity and mask out. This prevents passing disabled features to > guest. If we use cpu_count instead, which reports bits directly from Ah, you mean cpuid_count(). > CPU, then the bits of features that are disabled in host are passed to > guest as enabled. This seems be inconsistent. Ok, I see what you mean. So I guess we'll have to iterate over the cpuid_bits[] array and recreate the CPUID leaf for KVM instead, as I suggested earlier. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.