Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753544AbeAILSb (ORCPT + 1 other); Tue, 9 Jan 2018 06:18:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbeAILS3 (ORCPT ); Tue, 9 Jan 2018 06:18:29 -0500 Subject: Re: [PATCH 1/7] KVM: x86: add SPEC_CTRL and IBPB_SUPPORT accessors To: David Hildenbrand , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: jmattson@google.com, aliguori@amazon.com, thomas.lendacky@amd.com, dwmw@amazon.co.uk, bp@alien8.de References: <1515434925-10250-1-git-send-email-pbonzini@redhat.com> <1515434925-10250-2-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: Date: Tue, 9 Jan 2018 12:18:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 09 Jan 2018 11:18:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 09/01/2018 12:14, David Hildenbrand wrote: >> >> +/* These are scattered features in cpufeatures.h. */ >> +#define KVM_CPUID_BIT_AVX512_4VNNIW 2 >> +#define KVM_CPUID_BIT_AVX512_4FMAPS 3 >> +#define KVM_CPUID_BIT_SPEC_CTRL 26 >> +#define KVM_CPUID_BIT_STIBP 27 > I can see that STIBP is never checked in KVM code but only forwarded to > the guest if available. > > I am wondering if we would have to check against that, too, before > issuing a FEATURE_SET_IBPB. STIBP is "single-threaded indirect branch prediction". SPEC_CTRL always implies that FEATURE_SET_IBPB is available. Paolo