Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1865739ybi; Thu, 20 Jun 2019 05:17:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCslTCdfop95RuOYnbE7EM8T7jBesHJW81cm//lFTyApXfjUJjd2VmIlJ9kiOAHP+6pgh8 X-Received: by 2002:a17:902:2bcb:: with SMTP id l69mr17657943plb.155.1561033061558; Thu, 20 Jun 2019 05:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561033061; cv=none; d=google.com; s=arc-20160816; b=yq35+cSVecNyD9fx7uhSgysEl4Jb4dZD85jYRc1lULiUvkmlis6OwE59yexIAMjnoR c07AEvkqkuR3mBghHcfu30ZkruKsk0MFHmkmopzzClfrSH7sWrx4x596BAIaVzToASpV /vgAPjHCg6W6q4UB2HPU/+r2tRkCj/fpwSwl8zfvk/pTDQpZlfSPTMYcZHkoDXDxY852 bE/itOAV2Mh4aDeBbpmF/4Qen6zWwP2o+q22ByWnPQ6Rpc+s2iubtKbPjdPjle8LK0cO C9eSGRQLZ0kMBGONvGNyzyowIOoTTGgEZHKbgNJRd+W2UC13MNHOQI3D04pCqtvD4aXg OmZA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=B9TrtGyucT7ajjWuvboh+Hy5dvZksEd6/p4CR2fghIg=; b=utxjxwpSU9whS7jhtLM3TttVFdMy0S/PoMtFTgwAYRG//VxKp8SlhoCU4tQFQsrQe0 G4WegxJ7MZT7EJtL6iyTup4nEOSyszDn4HBYYKelW7Au4ow7N5EeERuIu60pvGyxJiCj WzemQ69VHhdQy20gDirfWUbHje+RpCh7CA+83jLj5pYQ3qaA7T2X5susM/qmffk8WIg+ uSCBHhht63s+Usr870YpQRvgWxmnPU44daR+f/B1i0USqp7VZUryvlCChU9dln4ub2xV 1BikcnSQLN9S1FI52HG9ISjmfoi8PPLWEKLry9uO2QnmOfZAyLu9hRi9dXiUJ0G5vMKm 8AwQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi8si17610366plb.352.2019.06.20.05.17.25; Thu, 20 Jun 2019 05:17:41 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731675AbfFTMQ0 (ORCPT + 99 others); Thu, 20 Jun 2019 08:16:26 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54404 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbfFTMQ0 (ORCPT ); Thu, 20 Jun 2019 08:16:26 -0400 Received: by mail-wm1-f65.google.com with SMTP id g135so2838164wme.4 for ; Thu, 20 Jun 2019 05:16:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=B9TrtGyucT7ajjWuvboh+Hy5dvZksEd6/p4CR2fghIg=; b=A7OSdNT+3bcSy1ZMZkS3doXRRWmpmYpQeUp4St2vBpbna8fSIVmsIS9lt3WYKmo/lg EzqpP4JIPR+rDBwn9eIdfa+SHiOKztBxJTL+qk/5VKA61zYADlRMNjSmLBVDdYUJMUJW hR3Ab56kzX7q/jSBDFCLr+akM0jJT6uJUX1g/n9LQcS7ApENETP6hiGMkvpLvOnxxHhF aKEQkfHaScVzOcCnMBweJBXO/tLULzPh204es0YFpM5r6Doo03PJOat7njbaSWfwIgYq GuTn8myiIsNyCac1W5vhxEb/GzA1l4MdyBTH0TvXlhNZ7cPLIwP7U8IreDMcDNfBdUDY BP5A== X-Gm-Message-State: APjAAAWmsRlflUz647COptG6tYWdaOUpP3dH5VJp2SJOjOKxkFEf5uil CTrn//BWEMcoD6YKVsPgfc2H6A== X-Received: by 2002:a1c:4484:: with SMTP id r126mr2782080wma.27.1561032984421; Thu, 20 Jun 2019 05:16:24 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:7822:aa18:a9d8:39ab? ([2001:b07:6468:f312:7822:aa18:a9d8:39ab]) by smtp.gmail.com with ESMTPSA id d18sm36464286wrb.90.2019.06.20.05.16.23 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2019 05:16:23 -0700 (PDT) Subject: Re: [PATCH RFC] kvm: x86: Expose AVX512_BF16 feature to guest To: Jing Liu , kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jing2.liu@intel.com References: <1561029712-11848-1-git-send-email-jing2.liu@linux.intel.com> <1561029712-11848-2-git-send-email-jing2.liu@linux.intel.com> From: Paolo Bonzini Message-ID: Date: Thu, 20 Jun 2019 14:16:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1561029712-11848-2-git-send-email-jing2.liu@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/06/19 13:21, Jing Liu wrote: > + for (i = 1; i <= times; i++) { > + if (*nent >= maxnent) > + goto out; > + do_cpuid_1_ent(&entry[i], function, i); > + entry[i].eax &= F(AVX512_BF16); > + entry[i].ebx = 0; > + entry[i].ecx = 0; > + entry[i].edx = 0; > + entry[i].flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; > + ++*nent; This woud be wrong for i > 1, so instead make this if (entry->eax >= 1) and define F(AVX512_BF16) as a new constant kvm_cpuid_7_1_eax_features. Paolo