From patchwork Thu Nov 9 07:20:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 13450719 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF62CFBF1 for ; Thu, 9 Nov 2023 07:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OK2pgU+z" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A2E62D50 for ; Wed, 8 Nov 2023 23:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699516223; x=1731052223; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MRaXk3shPh7gkjPfs7QFU/AG2qwffhxmzb8OZqrofHo=; b=OK2pgU+zV0KOQa8MyHhGVA8sGeTrYqpgg6/lhAYmKeg/m48Kn8AIV7an GFLf0/E4dFHsEvDDJzwM7i2u9df0lEgXf/1eckRJpFMoOSHiOt4JHs9ql lgBBUg18JzRhFsWT/5oGHNTYDggZev8dJEIMhbYxuW0bpEbOkX71ALR6V 3A9pu+bjOyatZrlSW/+xIyThD7ijpD2XlGX632yty1moOvnSHG4815eta 9A5xKVTg2js5EOE9b4UfH03OfKUc1u1guWwsgAciFpxfldsbfZ1rawFwC xkeBBPTKjGwCM4ge0rBjTCakJ2GADA2aQnQqOibnAT9w7qQqlceUF4dK2 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="476165153" X-IronPort-AV: E=Sophos;i="6.03,288,1694761200"; d="scan'208";a="476165153" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 23:50:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="763329284" X-IronPort-AV: E=Sophos;i="6.03,288,1694761200"; d="scan'208";a="763329284" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga002.jf.intel.com with ESMTP; 08 Nov 2023 23:50:22 -0800 From: Xin Li To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, richard.henderson@linaro.org, pbonzini@redhat.com, eduardo@habkost.net, seanjc@google.com, chao.gao@intel.com, hpa@zytor.com, xiaoyao.li@intel.com, weijiang.yang@intel.com Subject: [PATCH v3 4/6] target/i386: add support for VMX FRED controls Date: Wed, 8 Nov 2023 23:20:10 -0800 Message-ID: <20231109072012.8078-5-xin3.li@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109072012.8078-1-xin3.li@intel.com> References: <20231109072012.8078-1-xin3.li@intel.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add VMX FRED controls used to enable save/load of FRED MSRs. Tested-by: Shan Kang Signed-off-by: Xin Li --- scripts/kvm/vmxcap | 3 +++ target/i386/cpu.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index 7da1e00ca8..44898d73c2 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -229,6 +229,8 @@ controls = [ Allowed1Control( name = 'secondary VM-Exit controls', bits = { + 0: 'Save IA32 FRED MSRs', + 1: 'Load IA32 FRED MSRs', }, cap_msr = MSR_IA32_VMX_EXIT_CTLS2, ), @@ -246,6 +248,7 @@ controls = [ 16: 'Load IA32_BNDCFGS', 17: 'Conceal VM entries from PT', 18: 'Load IA32_RTIT_CTL', + 23: 'Load IA32 FRED MSRs', }, cap_msr = MSR_IA32_VMX_ENTRY_CTLS, true_cap_msr = MSR_IA32_VMX_TRUE_ENTRY_CTLS, diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 227ee1c759..dcf914a7ec 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1285,7 +1285,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { NULL, "vmx-entry-ia32e-mode", NULL, NULL, NULL, "vmx-entry-load-perf-global-ctrl", "vmx-entry-load-pat", "vmx-entry-load-efer", "vmx-entry-load-bndcfgs", NULL, "vmx-entry-load-rtit-ctl", NULL, - NULL, NULL, "vmx-entry-load-pkrs", NULL, + NULL, NULL, "vmx-entry-load-pkrs", "vmx-entry-load-fred", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, },