From nobody Mon Feb 9 12:26:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1612513946; cv=none; d=zohomail.com; s=zohoarc; b=UqMxrLNjdQLTVy/aBT0nzRfSAzbc4Z2/4TtbJubdODUsig7OJx0rCL2rVdIowI/iVfVSGvoWLm/ziihQ/BG4ITvAT98oKvKWElZUw+1nuf8v3j62iE5WBLYCuozD65z8u3c2pQgiLmrC7ncFETenbAgVsjgJmUQezQuFXE2cxtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612513946; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ddYdsdwteh6LPagdAnaO0DIZrOa9JJaM0TK1jZkgRsU=; b=dDTkq+p2V5Par7ST9XZJJ2gsFzkck/IqGzygmOQomJcia3KriYvMACt3VIcJ2hFGQXcLMabX9MRgm9jRgAzO2pgpUYVrPOBftPUOPVNmTouaJ1ouoAUJEaf+mkPbJN6Pf0AfkOt5ES4HD/HnvxG+hsKaZ0egB3DXrrAax08WDpo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16125139465901012.7265180431887; Fri, 5 Feb 2021 00:32:26 -0800 (PST) Received: from localhost ([::1]:33762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7wXQ-0003sM-Vh for importer@patchew.org; Fri, 05 Feb 2021 03:32:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7wVg-0002Ru-SB for qemu-devel@nongnu.org; Fri, 05 Feb 2021 03:30:36 -0500 Received: from mga02.intel.com ([134.134.136.20]:9788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7wVf-000213-1L for qemu-devel@nongnu.org; Fri, 05 Feb 2021 03:30:36 -0500 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 00:30:24 -0800 Received: from chenyi-pc.sh.intel.com ([10.239.159.24]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2021 00:30:21 -0800 IronPort-SDR: dRPwWyohsCfYpUhmSuZ1jfG4at1clPEqSQwCgo49L+wW3yzB7MsDGETRJXDOkUTCp5IjLlDkNO ZSOaI2bXqqjg== X-IronPort-AV: E=McAfee;i="6000,8403,9885"; a="168518447" X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="168518447" IronPort-SDR: fAONsr0cR/4n0Oc67xrJwFKxJiteK2GLbzYEZmMBsbo9ZRhWIMKtAt4vy7wDB3C69vCRtekz2Z G8PA+SriKQyQ== X-IronPort-AV: E=Sophos;i="5.81,154,1610438400"; d="scan'208";a="393760307" From: Chenyi Qiang To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , Xiaoyao Li Subject: [PATCH 2/2] target/i386: Expose VMX entry/exit load pkrs control bits Date: Fri, 5 Feb 2021 16:33:25 +0800 Message-Id: <20210205083325.13880-3-chenyi.qiang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210205083325.13880-1-chenyi.qiang@intel.com> References: <20210205083325.13880-1-chenyi.qiang@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.20; envelope-from=chenyi.qiang@intel.com; helo=mga02.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Expose the VMX exit/entry load pkrs control bits in VMX_TRUE_EXIT_CTLS/VMX_TRUE_ENTRY_CTLS MSRs to guest, which supports the PKS in nested VM. Signed-off-by: Chenyi Qiang --- target/i386/cpu.c | 4 ++-- target/i386/cpu.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 21136c61a8..0de67bbbb2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1215,7 +1215,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORD= S] =3D { "vmx-exit-save-efer", "vmx-exit-load-efer", "vmx-exit-save-preemption-timer", "vmx-exit-clear-bndcfgs", NULL, "vmx-exit-clear-rtit-ctl", NULL, NULL, - NULL, NULL, NULL, NULL, + NULL, "vmx-exit-load-pkrs", NULL, NULL, }, .msr =3D { .index =3D MSR_IA32_VMX_TRUE_EXIT_CTLS, @@ -1230,7 +1230,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORD= S] =3D { 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", NUL= L, - NULL, NULL, NULL, NULL, + NULL, NULL, "vmx-entry-load-pkrs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d7f3ef99d1..fbf65db4db 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -969,6 +969,7 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define VMX_VM_EXIT_CLEAR_BNDCFGS 0x00800000 #define VMX_VM_EXIT_PT_CONCEAL_PIP 0x01000000 #define VMX_VM_EXIT_CLEAR_IA32_RTIT_CTL 0x02000000 +#define VMX_VM_EXIT_LOAD_IA32_PKRS 0x20000000 =20 #define VMX_VM_ENTRY_LOAD_DEBUG_CONTROLS 0x00000004 #define VMX_VM_ENTRY_IA32E_MODE 0x00000200 @@ -980,6 +981,7 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; #define VMX_VM_ENTRY_LOAD_BNDCFGS 0x00010000 #define VMX_VM_ENTRY_PT_CONCEAL_PIP 0x00020000 #define VMX_VM_ENTRY_LOAD_IA32_RTIT_CTL 0x00040000 +#define VMX_VM_ENTRY_LOAD_IA32_PKRS 0x00400000 =20 /* Supported Hyper-V Enlightenments */ #define HYPERV_FEAT_RELAXED 0 --=20 2.17.1