Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp379587rwl; Fri, 4 Nov 2022 01:16:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7f5ZNKaQxd9wI8NGRDTUPdoafJYV0qdgqnm8BAOXH9BYvhzvGYt/C5A+PTEE1dw3M0J4pR X-Received: by 2002:a17:906:285a:b0:7ae:127a:cc2e with SMTP id s26-20020a170906285a00b007ae127acc2emr8488069ejc.229.1667549777365; Fri, 04 Nov 2022 01:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667549777; cv=none; d=google.com; s=arc-20160816; b=WQfHAVha2a6yvGhLTJoEy5TbZjPc5hfO81dLhqM9w6DInECbxwnl/ICe8zv8SCw8LA FgNq/GkPx2ROGVrfWrITmvo+ak2KeUppSrvdeY6Xvk9l2Ierb9LK2Wn4TXdOThq0Sy+N jIvg4k2vzcFxIWw2RcIpzx82MY7F6c5tzyS4np/mgNdj1/yvDEOHIJCm1OkaWDU+0H/g 462iLnXi2+LGHaO/e6RxLyUljo2eWFsv3lpsskNkLlrHVp/n1xVuLyGuuniCrtqmGvXm e2Oq8ivuITaX27z8NUwCMZPQDIhyp+D6BsQ6nX5OsswoKpd597uxJ8EIoKTRnCMB4Ju7 WJDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QJu1Z+r/Jj1Q22H/Z28kMZfifRbtSqoNatlqDbaYr8M=; b=1AojYDi0HhUgoUFIY3zAtJuuqtgfK1LY0P4KJDnPeoedHMtYOL7C4CBUpknlQ8XCb2 TayRnDz8T2FxNYMdKlj9qTxgr+b5q9JylwHLUmkqSqTtPxuO718pVOFJZQOQfYUV98G6 2yAYabc3XjM7mj1sWBbvlLuiDraqpH0D9tLUU8+gNRuVsTx8hd8c7oN3ozpJESncepKs YZeKxIFz87EAnEfNDxoyP6omMfmf2HnzRqu74EfNqg94PrmHXh4VVJnIUmzCOhnLD+hQ Q9noMVTSpS/Hd0VihtlwyKBntsIG7YF8Eg6akc/fptLt6JhHSxYiM167zeC+Z1PL2vv0 1X1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ht881+Jl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp15-20020a170906c14f00b007833c7cf1dcsi3751340ejc.387.2022.11.04.01.15.54; Fri, 04 Nov 2022 01:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ht881+Jl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiKDIDq (ORCPT + 96 others); Fri, 4 Nov 2022 04:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiKDIDn (ORCPT ); Fri, 4 Nov 2022 04:03:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C562655E for ; Fri, 4 Nov 2022 01:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667548958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QJu1Z+r/Jj1Q22H/Z28kMZfifRbtSqoNatlqDbaYr8M=; b=Ht881+Jlk5g+JMhSSLNDUJyiPl1UFMFDxFF9LzjwLU9xxQgu9oKJvvXsOJj+Pzlzgrs21E J6OWFWTWg6jrvcXwWk8vnmUSA/DI3Gv4bwgJ5W2BUCe0SyMptQeSs7A7RaSLTJfhITqF2S C16Sm+gvNoncb4hATdNLsdRfOpIH/fg= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-425-nOPAPYFpO8yLmdVu6LAL-w-1; Fri, 04 Nov 2022 04:02:37 -0400 X-MC-Unique: nOPAPYFpO8yLmdVu6LAL-w-1 Received: by mail-ed1-f72.google.com with SMTP id b14-20020a056402278e00b004621a2642d7so2979395ede.1 for ; Fri, 04 Nov 2022 01:02:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QJu1Z+r/Jj1Q22H/Z28kMZfifRbtSqoNatlqDbaYr8M=; b=q40BJjp6SE8VkzGO2MYw5IApsylPtLGG6vV5pq/wDgovabK11cu40CtitBaTdXXkIV ynx5WvMY13kbiNCRBJy1ym0pE6RhzGw9nKyUe2j+e6PA2sb2FrcmBdkxJagLGrk3mOOc 5vnXRYcu08x5nMbpmKW0NRCZX09IDzFf/GohedYt08Mlu7gHKR+6gBnWR5uewbXwy/bj JnylT39y4gdzA9ZNJDKhzO4DeRAsPWoeo8GXWFgQHjUcQUerVFFatYdNlegI0gD7BqQl QXvgU3seRmL5pP9URkmpVA2eQafzd6O7Bai083iPzg6GIzjPdaCSJV2WZFQobmiuWnPn Vpsg== X-Gm-Message-State: ACrzQf1tofsbAkhhVRvuNcN0rZ8v35vZg1MyA9d+Yy2dz/p2I2hLPnZA TLgGHJbUtYNnsI/XWjkphvGn50G7VVpTiBViEItHoEsSyGMnWANfsEzN+mq1q+1flccKQvLSdK3 UUv6kYgHDFz+h39Oi/0NtKqcw X-Received: by 2002:a17:907:1dda:b0:7a6:8ffc:7dc with SMTP id og26-20020a1709071dda00b007a68ffc07dcmr33676998ejc.163.1667548955854; Fri, 04 Nov 2022 01:02:35 -0700 (PDT) X-Received: by 2002:a17:907:1dda:b0:7a6:8ffc:7dc with SMTP id og26-20020a1709071dda00b007a68ffc07dcmr33676971ejc.163.1667548955613; Fri, 04 Nov 2022 01:02:35 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:4783:a68:c1ee:15c5? ([2001:b07:6468:f312:4783:a68:c1ee:15c5]) by smtp.googlemail.com with ESMTPSA id tz14-20020a170907c78e00b0078ddb518a90sm1433630ejc.223.2022.11.04.01.02.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Nov 2022 01:02:34 -0700 (PDT) Message-ID: <6c71fcca-c17f-5979-e15e-afcf08899064@redhat.com> Date: Fri, 4 Nov 2022 09:02:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 33/44] KVM: x86: Do VMX/SVM support checks directly in vendor code Content-Language: en-US To: Sean Christopherson Cc: Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Matthew Rosato , Eric Farman , Vitaly Kuznetsov , James Morse , Alexandru Elisei , Suzuki K Poulose , Oliver Upton , Atish Patra , David Hildenbrand , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Isaku Yamahata , Fabiano Rosas , Michael Ellerman , Chao Gao , Thomas Gleixner , Yuan Yao References: <20221102231911.3107438-1-seanjc@google.com> <20221102231911.3107438-34-seanjc@google.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/22 19:58, Sean Christopherson wrote: > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index 3e508f239098..ebe617ab0b37 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel/cpu/common.c > @@ -191,6 +191,8 @@ static void default_init(struct cpuinfo_x86 *c) > strcpy(c->x86_model_id, "386"); > } > #endif > + > + clear_cpu_cap(c, X86_FEATURE_MSR_IA32_FEAT_CTL); > } > > static const struct cpu_dev default_cpu = { Not needed I think? default_init does not call init_ia32_feat_ctl. > diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c > index c881bcafba7d..3a7ae67f5a5e 100644 > --- a/arch/x86/kernel/cpu/cpuid-deps.c > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > @@ -72,6 +72,8 @@ static const struct cpuid_dep cpuid_deps[] = { > { X86_FEATURE_AVX512_FP16, X86_FEATURE_AVX512BW }, > { X86_FEATURE_ENQCMD, X86_FEATURE_XSAVES }, > { X86_FEATURE_PER_THREAD_MBA, X86_FEATURE_MBA }, > + { X86_FEATURE_VMX, X86_FEATURE_MSR_IA32_FEAT_CTL }, > + { X86_FEATURE_SGX, X86_FEATURE_MSR_IA32_FEAT_CTL }, > { X86_FEATURE_SGX_LC, X86_FEATURE_SGX }, > { X86_FEATURE_SGX1, X86_FEATURE_SGX }, > { X86_FEATURE_SGX2, X86_FEATURE_SGX1 }, > Yes, good idea. Paolo