Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3643129rdb; Wed, 13 Sep 2023 20:07:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoUtNU2QHpQs69nFo1fqi0G9E+BMlHj2mKafSwoI3FNSzi28cmwcYdl8kOE6nZpr30hejV X-Received: by 2002:a17:902:f68a:b0:1bf:11ce:c6ae with SMTP id l10-20020a170902f68a00b001bf11cec6aemr5154037plg.18.1694660831845; Wed, 13 Sep 2023 20:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694660831; cv=none; d=google.com; s=arc-20160816; b=cWbfUq4WgI1jHJIiPblxMVVd0+155TB/IrY0qq/DF0hMyuPyDmWUxqKkNtg6WPBfu/ D/TqsqXa2RNwz00OtE0kp1tBZRyFzbGrkuiLlmv7MGPQ00tfFD1QERogqp42AREkVosb Q2RxDXMIOeAaJgOeBGZZ41wFJlJTtrsC06BD0MW44OHaLSJPjZodnXZusZnJ+KesYE7Y ASUGPSr5ETAaX2qBRHPt5LnKgQR9MQKuvQDIy+aPxV2MeOwkGPqcZb/z/2gzzRYFYJD+ aZHzxz2CczUNqcXdVTkbgeLhqL68yZXlapYCfQ9cKQfy236MEIDUEcwXpTIUW345K+tZ m2+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=stRruY81EuhG99r1pLHoDNVZ2AeBM9wGocc6vqQgFaI=; fh=XU07i6VjSHyq3GxtsXSBrQ3+Dy8rztqr00WST2j1mn0=; b=g8a57rasb6dsOIeqmfYurRhvkNjCp0kCYaNlybHGOIIO+acvUwoOoPvJspcb9rtr9k I/RRex6DqWnd0A5HXjG7YhZ1OiuDGDof1Y93Q5owKiDzIDkb6Wcn8EF5NPcxvGXwTYYN 2fGBT8zAsI6/Es5DjPwIl+uHLtGfA/z77Z7vAqhZyFYbbzujKf1WpWHOw54BLvekUJwe rLGuYZKhK3O8jdi3WX70UfDV7xuar1+EmF2EU7IAZ/Qx14LZJ2IbHBujma5qdXQzp5KU BaQDlmHfFKBVAVmmKUcivq9xv9rK+ElYiMxCH765RfpSO0PlcirlxnqkEpPd4w6P1PXA uN/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JTSU3LpL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001c320085a7esi648622plk.645.2023.09.13.20.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 20:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=JTSU3LpL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 09DCB81DF27D; Wed, 13 Sep 2023 08:42:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjIMPl2 (ORCPT + 99 others); Wed, 13 Sep 2023 11:41:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbjIMPkz (ORCPT ); Wed, 13 Sep 2023 11:40:55 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 698531BE4; Wed, 13 Sep 2023 08:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694619626; x=1726155626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aFM3zDu49yerMd0myGuj4WSkYy3hmOJ/G+i4h2Pdn1k=; b=JTSU3LpLXQkZih1l9A7e0m1vMi5A70qT3GqcPE8GWzVwSiPx1ZfbfaVF xleR7R2n/UTqcxApmem35ztrMQ6hDEf8EYk2XdINPv62tyng/b+d9ljHU mgTili5s3hrtQu7+0G9lY6E6ejNugnOPRQklHC7zqh+wWoN8YACxP6uSi +STP1hPCRxaOBlRfKQrCRTHd7CGhCRqDA8jNrhkZ3tHfUfkJ+pSRO+812 XMUajGTzFz4Wa5sW8OrFSnAP6Ei9D4PP06RDbzRz9dRY7+Pz8rqEh7p+k 60LQ1gLmcNHuIkEimo3RT+1tPkXV9xvrx1RkRwswMxN6ex3Hc/nwanBn6 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="376030312" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="376030312" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 08:40:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10832"; a="867852277" X-IronPort-AV: E=Sophos;i="6.02,143,1688454000"; d="scan'208";a="867852277" Received: from binbinwu-mobl.ccr.corp.intel.com (HELO binbinwu-mobl.sh.intel.com) ([10.93.2.44]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2023 08:40:23 -0700 From: Binbin Wu To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: seanjc@google.com, pbonzini@redhat.com, chao.gao@intel.com, kai.huang@intel.com, David.Laight@ACULAB.COM, robert.hu@linux.intel.com, guang.zeng@intel.com, binbin.wu@linux.intel.com Subject: [PATCH v11 16/16] KVM: x86: Advertise LASS CPUID to user space Date: Wed, 13 Sep 2023 20:42:27 +0800 Message-Id: <20230913124227.12574-17-binbin.wu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230913124227.12574-1-binbin.wu@linux.intel.com> References: <20230913124227.12574-1-binbin.wu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:42:45 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email From: Zeng Guang Linear address space separation (LASS) 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. Note: KVM LASS feature exposure also depends on cpuid capability held by host kernel. It will be masked to guest if host vsyscall is in emulate mode which actually disables LASS. Signed-off-by: Zeng Guang Signed-off-by: Binbin Wu Tested-by: Xuelian Guo --- arch/x86/kvm/cpuid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index a0db266bab73..81a52218c20f 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -675,7 +675,7 @@ 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(AVX_VNNI) | F(AVX512_BF16) | F(LASS) | F(CMPCCXADD) | F(FZRM) | F(FSRS) | F(FSRC) | F(AMX_FP16) | F(AVX_IFMA) | F(LAM) ); -- 2.25.1