Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3151602pxb; Sat, 6 Feb 2021 22:59:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwoNhvlj5+K9HNTugpIvHWnHxSiAQcRK6CGPFAqv7AMmpcSmm9n6l/ixRYwPKPBeXD9K9zE X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr11308028ejv.467.1612681191856; Sat, 06 Feb 2021 22:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612681191; cv=none; d=google.com; s=arc-20160816; b=fQG97mKTWCTlYv4ormcsMG4Ey1mrosYO7NYWbUiSrNPTf02Fd++yp0MMN3PZrxFCgQ 1wf9xd9PVQVaI/elD5VdjWa3NP8G94mQXLSVxL8YbYg+FXZSpRv/0x4nl/8HfkDiHqKq UyJ8A82UsxAYLF3IJw6fynnsB9Qb+0pZtD0U8D5sp88nWgzs4f7IEAn8cV3ttqIvEc+l JK1Dnaq0ixCZ0Xvtwnajbf9sPvOOfM9ilUwOhTsUliolAr9ANPmJq8R5cCc6TzpDueOv rmD88ZyfCSq1D7z15Sa0a9JsvTnsiLVEepOSCBoR7stvlShoNtzO5/J3loyp76i7wzTj Qq3w== 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:ironport-sdr:ironport-sdr; bh=gLRKI7DsGgP7ERBXGcmFURxhSGySu61cEHkW+prIPPM=; b=F0XGl+e1A4igW1I8keKCNL2XsqwPjAfI0AIOdH8uQLgqj7eR7ZO7lNWyjrRVAS0mih 4R2478uRVMMEK4Xtq9ISB14nEhDHqJYPRRKOUudNvOEpyIrI7YX3SdLdVHmHVhLHn0te ZA9XZMcbHJ3QWFzx9wPiF94QJRtoY89JsuGPiEu+ShVH3JgJVNYWLFXSDrYGBVM6uYVi nxgGgBRTayDeyXZ6JvZ9hZCHWVjqVWqalwkSaiKd3srcAlyZ0KsqMHyCSgiGf6H8fHsH 5aFutx9Ip4ii6er68t7LNbOU0LKBgDK4gu9fcTdIh4rdK1ndSQO/BVaqfArkKPSY5RA+ 4aAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si8803723edd.316.2021.02.06.22.59.28; Sat, 06 Feb 2021 22:59:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbhBGG4e (ORCPT + 99 others); Sun, 7 Feb 2021 01:56:34 -0500 Received: from mga07.intel.com ([134.134.136.100]:48431 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbhBGG4d (ORCPT ); Sun, 7 Feb 2021 01:56:33 -0500 IronPort-SDR: 3GTvJJnbRjzp4nUoXOTww258BFH+aZoQgA97PqCiZajHDHzReqZsijm9zl/ObGlEV1NouFVKCj ql7diPm3UH5g== X-IronPort-AV: E=McAfee;i="6000,8403,9887"; a="245660843" X-IronPort-AV: E=Sophos;i="5.81,159,1610438400"; d="scan'208";a="245660843" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2021 22:54:45 -0800 IronPort-SDR: bZjtW2cyg+iTRXU9kcYbw194kx7IhBTOrbnlSPqgzGgDPId9vZLjXGEEmx4zyOK1aMt90Mn+TD qYpI1/P4LIOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,159,1610438400"; d="scan'208";a="410376574" Received: from vmmteam.bj.intel.com ([10.240.193.86]) by fmsmga004.fm.intel.com with ESMTP; 06 Feb 2021 22:54:43 -0800 From: Jing Liu To: pbonzini@redhat.com, seanjc@google.com, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jing2.liu@intel.com Subject: [PATCH RFC 1/7] kvm: x86: Expose XFD CPUID to guest Date: Sun, 7 Feb 2021 10:42:50 -0500 Message-Id: <20210207154256.52850-2-jing2.liu@linux.intel.com> X-Mailer: git-send-email 2.18.4 In-Reply-To: <20210207154256.52850-1-jing2.liu@linux.intel.com> References: <20210207154256.52850-1-jing2.liu@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intel's Extended Feature Disable (XFD) feature is an extension to the XSAVE feature that allows an operating system to enable a feature while preventing specific user threads from using the feature. A processor that supports XFD enumerates CPUID.(EAX=0DH,ECX=1):EAX[4] as 1. Signed-off-by: Jing Liu --- 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 83637a2ff605..04a73c395c71 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -437,7 +437,7 @@ void kvm_set_cpu_caps(void) ); kvm_cpu_cap_mask(CPUID_D_1_EAX, - F(XSAVEOPT) | F(XSAVEC) | F(XGETBV1) | F(XSAVES) + F(XSAVEOPT) | F(XSAVEC) | F(XGETBV1) | F(XSAVES) | F(XFD) ); kvm_cpu_cap_mask(CPUID_8000_0001_ECX, -- 2.18.4