Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2281087imb; Mon, 4 Mar 2019 00:40:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzhdiqDveUzwPZGKX1z+z3zViBj/Amd49smzy8D+jaaqUBzKWkdT0kdJ1P1sbxJAU0/iy3n X-Received: by 2002:a17:902:d88c:: with SMTP id b12mr2562585plz.339.1551688803676; Mon, 04 Mar 2019 00:40:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551688803; cv=none; d=google.com; s=arc-20160816; b=GfXOBYR5IJKGb1eZB5drVWZsZbaVb+AUoe+dmDGnhM4KkGuatkPz3ZaQX1RmeOK9a5 lkP+tjbF98Y+4oGRmnoBPNMoUXUSL6eF6PjC4pxMFE6gd3flVn4V0xvqH5GeYaJ9cwnQ LwXgdkCPhVjh/PHjfYlqgyGSBMp7k6ZVWxwQXqOF9jyfsIPhcZqEYFPCqMdUeKUzN2QB 9l0EfGETyDXEwV+hVBHffwoVe79ztK3zKWgdFrBfSr8UvgETrRMTXCQqx7WRdjxyXEII FNuIxlQhFmrg1ZxxqBad1RgOhY1VhCOXmd6lnXttjch8dmFvgsHDa+F3PYBNlAQApA6z GuEw== 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:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=Ymq30fkqmJ7dOVGc96va5pf/DIcXmARhzC+kkHJwUSo=; b=NPvGu8YP5JfAIFJp6pEIlGoNp6+DSPpIT05cTMKQsJjAzlP1tddKThwhkRBSoGz6Gu uqDnc51ae8DpBn3TZcEB/PPPMpRRNOe+N9E7g53O3cyL6qMSQiDfy0KUYU34eVF2Df22 6lsihFkpoMdQIT84Bc8fGUqxivnoE2lIx4fcsxjHZ67TG89DBEuDWYEQ9Km7PYtO1yos v0/f9tkzyX465pmjEOTM/ZbIIA76KvKgdIfgLyoH61rJzvH59njCgZBxSeu2Y+OOHnvP yc0swK2REE0ZaAOAGJqEwAGQus/Sl9YBdxCnbnGYKqi4GsloWAd301fwjlMK/qPfnZuM 2ErA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="papop/1v"; 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 r133si4779610pgr.175.2019.03.04.00.39.44; Mon, 04 Mar 2019 00:40:03 -0800 (PST) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="papop/1v"; 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 S1728026AbfCDIjF (ORCPT + 99 others); Mon, 4 Mar 2019 03:39:05 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55911 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbfCDIjC (ORCPT ); Mon, 4 Mar 2019 03:39:02 -0500 Received: by mail-wm1-f66.google.com with SMTP id q187so3711606wme.5; Mon, 04 Mar 2019 00:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ymq30fkqmJ7dOVGc96va5pf/DIcXmARhzC+kkHJwUSo=; b=papop/1vdhi+zdDEvu+eAGmfVsTl28lRZp2qSp2yZXTNE6lqda+xP1GwseA5kG/mY8 /l7ZFeJB1EcKzxT+92yFJAVTG1XgeR+Z0RmRCVHVThWG1DtE5lF/32pzu6EYoN4zZW/x uy+G4HN1BAes4IsUooAdMMel1YAlXhkN+m4l8tHzhL5uUV7FI+AwbxwK5/l5iz8bZn2a z0PHalP2NKq755PFHbAJy7ITbmeXT/rGkLC3TSvvy9B43rhuOU3C/txpslOxixvkY/hq p/c+yYoEPkS/AhxJGQiokRJNQzD1kdE+Nu7OwqO3bB9GblxUw/PZz6Ry3S4X8yvsuVRm 3p1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Ymq30fkqmJ7dOVGc96va5pf/DIcXmARhzC+kkHJwUSo=; b=FJoTdOOA+uQG7bv6YuMNF+JaKQqJmZwezDyif5myi9sI3SsE9sT/IXcFgJ3jldJuoE YQujl9z9zjA0vZQVh7M6DCRw9v0G9tYWqjUfYmjDsSD1vXuIxnixJ39J1C51qFcI8bPI xgGw+voj5aRwia8rQx6MThTr1ibXdSuWVH2xXsoNpCfiAI79hfYzcTgLk5zAvox2vvtv mnF73yrDqD+O9zc5j6ut7aTGFQWB5WnpDyNzuegT2LI2l2S4e7o67zJEiLHIKT9YBicP JfcU9HBkQcGEBOeroKFQDn7mOCrZamVzQkOAVb1h3dCywZO9DdLHXKnL/x2k8NLYeq0N Y6Mg== X-Gm-Message-State: APjAAAWZxT/7ym6s/QnPsF2SUI4Nkk2Y1bJaqM63g9H+3NqaysrD+sTb T/4XSAJVBhougvIfemYMkJo= X-Received: by 2002:a1c:9ad4:: with SMTP id c203mr10632912wme.69.1551688739995; Mon, 04 Mar 2019 00:38:59 -0800 (PST) Received: from ?IPv6:2001:b07:6468:f312:102e:b101:9b89:f7ef? ([2001:b07:6468:f312:102e:b101:9b89:f7ef]) by smtp.googlemail.com with ESMTPSA id j8sm6448854wro.52.2019.03.04.00.38.58 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 00:38:59 -0800 (PST) Subject: Re: [PATCH v4 15/17] kvm: x86: Report CORE_CAPABILITY on GET_SUPPORTED_CPUID To: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Dave Hansen , Ashok Raj , Peter Zijlstra , Ravi V Shankar , Xiaoyao Li Cc: linux-kernel , x86 , kvm@vger.kernel.org, Xiaoyao Li References: <1551494711-213533-1-git-send-email-fenghua.yu@intel.com> <1551494711-213533-16-git-send-email-fenghua.yu@intel.com> From: Paolo Bonzini Openpgp: preference=signencrypt Autocrypt: addr=pbonzini@redhat.com; keydata= mQHhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT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hVSiAd2jioGuTjX6AZCFv3ToO53DliFMkVTecLptsXaes uUHgL9dKIfvpm+rNXRn9wAwGjk0X/A== Message-ID: <697ee0bd-a5f6-7712-017e-455eed5bc185@redhat.com> Date: Mon, 4 Mar 2019 09:38:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1551494711-213533-16-git-send-email-fenghua.yu@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 02/03/19 03:45, Fenghua Yu wrote: > From: Xiaoyao Li > > In the latest Intel SDM, CPUID.(EAX=7H,ECX=0):EDX[30] will enumerate > the presence of the IA32_CORE_CAPABILITY MSR. > > Update GET_SUPPORTED_CPUID to expose this feature bit to user space, so > that user space know this bit can be enabled in CPUID. > > Signed-off-by: Xiaoyao Li > --- > arch/x86/kvm/cpuid.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index c07958b59f50..e0e17b9c65da 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -410,7 +410,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, > /* cpuid 7.0.edx*/ > const u32 kvm_cpuid_7_0_edx_x86_features = > F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) | > - F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP); > + F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(CORE_CAPABILITY) | > + F(INTEL_STIBP); This should be enabled always if boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT), since the MSR is emulated. This way, guests can always rely on IA32_CORE_CAPABILITY_MSR and it won't have to rely on the FMS (which means nothing inside a guest). Paolo > /* all calls to cpuid_count() should be made on the same cpu */ > get_cpu(); >