Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp873411rwr; Thu, 20 Apr 2023 07:20:48 -0700 (PDT) X-Google-Smtp-Source: AKy350ZdW0/l08kfyTlHHSM8ZpRlWGN2Aj9+f4WuLP64zk2ZmaDPT3n3KMsnfV9yARqWTnMOHwQc X-Received: by 2002:a17:90a:d793:b0:234:5d3c:b02b with SMTP id z19-20020a17090ad79300b002345d3cb02bmr1847128pju.42.1682000447897; Thu, 20 Apr 2023 07:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682000447; cv=none; d=google.com; s=arc-20160816; b=mKLeG/gPwkc17WMBdb1D6aYw5tAkXW0UtrBN7liN0g3VRuZTEkrl41BsXBvoTQB/RI A2MtjvWsA2ynT161eZa6DnvBAI2OdOSsb3ILITO4I4B2VXpR2NJoLTjIaYR+miBVBghO tZ2wgINvdX4ZCw+jx0GMV8jOmg0G8fr2YGZrTX04w6bcD8XuE0tLfrikqzuJUtXbc2pU KSWVKmxo4Fz68piArsUciQXHj5mzJIylJo2GjmYvqfN6WE+oA/nFv5R5BKKzTlevRDcn Jh5i/DNk6HmtGNOmg1fFGEZw6B93i+I3tQIHID3bVT2yPacEHOn5Bn3fp4GNQ5xiRhuZ 3Nrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=O6UlCGL1bWb2Pmfj9Y5Tepq3fChrvjOPq8vSAGt0dek=; b=NxhmFLXfeUdeTGYarnozoUtXOksr/P6+rdsGreAGm0advzOOl8CDAe8oZuNqaGukL1 EU7ocV0X1ej4GnHUWpE+3/tiszmrhdyD7Iar0YG5ye8dHNdwpPRz0yTvZM6tGiq3aqtv RqFW36W7Cjg9lOVH26C6DnbKVPQXrZ6dSddDjpRQtAr79RaW89YVA9K8bLHujeXF7QuR pCHo1oFQo+9jZs4H3h0kRMeHt4imEtB8LZXqJ/uY+3h0tlRnbWFGyvt2O0B8Vft63qtt jp8FT/MHl+d12aaPsZspBVfhm425YMJ6kdxcqHjpqq54pLkpyn25AGdG2ZNGtKAu7l/r QNvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FGLh1XN6; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk17-20020a17090b225100b0024b27e48a27si4348187pjb.74.2023.04.20.07.20.20; Thu, 20 Apr 2023 07:20:47 -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=@intel.com header.s=Intel header.b=FGLh1XN6; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbjDTOQg (ORCPT + 99 others); Thu, 20 Apr 2023 10:16:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231962AbjDTOQV (ORCPT ); Thu, 20 Apr 2023 10:16:21 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 967FE5594; Thu, 20 Apr 2023 07:16:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682000180; x=1713536180; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=/9rOO3Vbv54KntD8O0wgn+L44l9VgaKRnztR0QPc7F0=; b=FGLh1XN6L0CmuLbhgRPOwS0kpy2wfbadqE3Vrb+pdgG60Jx9yNssS98X TKHqfr5a4AwcdCr/ljmidxJ8209H29UESkdaNwNmzvCTSo092PF8PoOEz nWjmNf9I8JCLeBT9avg8JBQKSXr3whtGJXIxBqsfdkamiFbab2exkapZK GLRZhXykzXToKbj5/lBDTxlybZFUqY/1WxlHWHYuDHRxcYdUI12bV97Fp sjnoNBpc/cz3+XQ2RT1vqEJMVukI6OTJZ4Mcf0sclr0+Hc/FmXUKtex6E QklRIumkp76Ks6MjLrw/t+rDsEy3DA9m1Ufn8GFNg5W1D/mPHU9uGail6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="343217863" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="343217863" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 07:16:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10686"; a="816028909" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="816028909" Received: from arthur-vostro-3668.sh.intel.com ([10.238.200.53]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 07:16:13 -0700 From: Zeng Guang To: Paolo Bonzini , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , H Peter Anvin , kvm@vger.kernel.org Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Gao Chao , Zeng Guang Subject: [PATCH 5/6] KVM: x86: Advertise LASS CPUID to user space Date: Thu, 20 Apr 2023 21:37:23 +0800 Message-Id: <20230420133724.11398-6-guang.zeng@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230420133724.11398-1-guang.zeng@intel.com> References: <20230420133724.11398-1-guang.zeng@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 LASS (Linear-address space separation) is an independent mechanism to enforce the mode-based protection that can prevent user-mode accesses to supervisor-mode addresses, and vice versa. Because the LASS protections are applied before paging, malicious software can not acquire any paging-based timing information to compromise the security of system. The CPUID bit definition to support LASS: CPUID.(EAX=07H.ECX=1):EAX.LASS[bit 6] Advertise LASS to user space to support LASS virtualization. Signed-off-by: Zeng Guang --- arch/x86/kvm/cpuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index ba7f7abc8964..5facb8037140 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -663,8 +663,8 @@ void kvm_set_cpu_caps(void) kvm_cpu_cap_set(X86_FEATURE_SPEC_CTRL_SSBD); kvm_cpu_cap_mask(CPUID_7_1_EAX, - F(AVX_VNNI) | F(AVX512_BF16) | F(CMPCCXADD) | F(AMX_FP16) | - F(AVX_IFMA) + F(AVX_VNNI) | F(AVX512_BF16) | F(LASS) | F(CMPCCXADD) | + F(AMX_FP16) | F(AVX_IFMA) ); kvm_cpu_cap_init_kvm_defined(CPUID_7_1_EDX, -- 2.27.0