From nobody Sun May 5 17:09:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52494+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52494+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1577084162; cv=none; d=zohomail.com; s=zohoarc; b=n/cgyNmGF0bYCL4b7EYLi+JTJcph2/litOjc6W6mXk1NhNAbalS572HKVhUdJ2CJ7gBf9y53egDOZSQj/5ggLdLpdOTSaZ1JEfZhz8DWthAGyAXtVOnUgmEqPnjbRGRz7IfZcgZCe5qvM+W8d9BmEU0h2x4gNKbhVTL/ZoNLQjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577084162; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=QOzl+7Rnqa0VSK1MBcRyFJObGB75R4RGielmV7+Lz+M=; b=DXY9wOzOKOoSjT0hN//kzggtlU+i3Jfbc3NbeQ3c/p9EjoC/uptdWr1J1LDK5rkC5PUBh7CLIsVYN1rd0lUJSx0psXEqmV5eJdcxO0J68Oc1VrtzFjT/z8LE5DqXQM50gxgOXL/xfBpSSti37gEr4I2hW5H/JswLrePTMdYca4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52494+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1577084162229755.0444521731814; Sun, 22 Dec 2019 22:56:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id XQm0YY1788612xaVpCCQ5Pxl; Sun, 22 Dec 2019 22:56:01 -0800 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.410.1577084160583910651 for ; Sun, 22 Dec 2019 22:56:01 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2019 22:56:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,346,1571727600"; d="scan'208";a="211454618" X-Received: from lgao4-mobl1.ccr.corp.intel.com ([10.255.29.23]) by orsmga008.jf.intel.com with ESMTP; 22 Dec 2019 22:55:59 -0800 From: "Liming Gao" To: devel@edk2.groups.io Cc: Jason Voelz , Ray Ni Subject: [edk2-devel] [Patch 1/2] MdePkg BaseLib.h: Update IA32_CR4 strut to include all public fields Date: Mon, 23 Dec 2019 14:55:36 +0800 Message-Id: <20191223065537.32468-2-liming.gao@intel.com> In-Reply-To: <20191223065537.32468-1-liming.gao@intel.com> References: <20191223065537.32468-1-liming.gao@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,liming.gao@intel.com X-Gm-Message-State: NJeRQxOj3sVbTa3gzoeCGxPWx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1577084161; bh=CXFwa/ke+BuCT399g0nvTlYNNoE9/UVckMAywEBESjc=; h=Cc:Date:From:Reply-To:Subject:To; b=rNwk8vIfwHpwh30QYLlMquv4XyLwNdc+RE6OQ+zpo5o3YwQQIYWupYTxsghrt1rRwIm jONz6eaoPAlviZnzYcmFf6Eiew04rhV8+Cpq4soLWO8tYsSmTLAgs1gXGd+OT6G/WDN1n uXvpvp2/mXWGuhgaHWlStMZUBMTZYsHMyFw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jason Voelz Based on Intel Software Develeper's Manual, add all fields in IA32_CR4. Signed-off-by: Jason Voelz Cc: Liming Gao Cc: Ray Ni Reviewed-by: Ray Ni --- MdePkg/Include/Library/BaseLib.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 2a75bc023f..ecadff8b23 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -5387,10 +5387,19 @@ typedef union { UINT32 OSXMMEXCPT:1; ///< Operating System Support for ///< Unmasked SIMD Floating Point ///< Exceptions. - UINT32 Reserved_2:1; ///< Reserved. + UINT32 UMIP:1; ///< User-Mode Instruction Prevention. UINT32 LA57:1; ///< Linear Address 57bit. - UINT32 VMXE:1; ///< VMX Enable - UINT32 Reserved_1:18; ///< Reserved. + UINT32 VMXE:1; ///< VMX Enable. + UINT32 SMXE:1; ///< SMX Enable. + UINT32 Reserved_3:1; ///< Reserved. + UINT32 FSGSBASE:1; ///< FSGSBASE Enable. + UINT32 PCIDE:1; ///< PCID Enable. + UINT32 OSXSAVE:1; ///< XSAVE and Processor Extended States Enabl= e. + UINT32 Reserved_4:1; ///< Reserved. + UINT32 SMEP:1; ///< SMEP Enable. + UINT32 SMAP:1; ///< SMAP Enable. + UINT32 PKE:1; ///< Protection-Key Enable. + UINT32 Reserved_5:9; ///< Reserved. } Bits; UINTN UintN; } IA32_CR4; --=20 2.13.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52494): https://edk2.groups.io/g/devel/message/52494 Mute This Topic: https://groups.io/mt/69226209/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 17:09:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+52495+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52495+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1577084163; cv=none; d=zohomail.com; s=zohoarc; b=H1SJBUrJmMTfoGDn4rW+GxPyZQiPD8yWVdry6lSM9ATK79bvJn+uYXgD4Ujq/QRrwpI7NzdqV6FIR8Gcc1yvNuMfGBn74nDKdzflI8HgIiev7/kiwl9wpK24YCbXkBCnsS5gH6g/5zG7qiDSBgejnVoGGi6kkrZe/DC8B5DrOQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577084163; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ERJR/6bJoBbOi11pPpjuU3LLlRXxHIB3wwoPqKY0jyw=; b=JgphqC0H6Pk4EE1iRjoU1AgnElmKH20VP2Drd5AWpccHptOlKWIuMiMAAtinOhRktoqbKkGAhpzmWb850OdQw1P0c8zm15i29Sob+thvdSjwspoQC6LzgU/PhesiTHRkT6H+56oZkYzlXMIsQj3o82hkbUzYbJqmxlK3uF+ZTUk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+52495+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15770841632301019.0213331068915; Sun, 22 Dec 2019 22:56:03 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id VCkRYY1788612xS2DHWxjSWb; Sun, 22 Dec 2019 22:56:02 -0800 X-Received: from mga07.intel.com (mga07.intel.com []) by mx.groups.io with SMTP id smtpd.web12.410.1577084160583910651 for ; Sun, 22 Dec 2019 22:56:02 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2019 22:56:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,346,1571727600"; d="scan'208";a="211454629" X-Received: from lgao4-mobl1.ccr.corp.intel.com ([10.255.29.23]) by orsmga008.jf.intel.com with ESMTP; 22 Dec 2019 22:56:00 -0800 From: "Liming Gao" To: devel@edk2.groups.io Cc: Jason Voelz , Ray Ni Subject: [edk2-devel] [Patch 2/2] UefiCpuPkg/CpuCommonFeaturesLib: SMXE bit of CR4 should set Date: Mon, 23 Dec 2019 14:55:37 +0800 Message-Id: <20191223065537.32468-3-liming.gao@intel.com> In-Reply-To: <20191223065537.32468-1-liming.gao@intel.com> References: <20191223065537.32468-1-liming.gao@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,liming.gao@intel.com X-Gm-Message-State: LJhAGOk4QJXOZdMzSr368QJmx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1577084162; bh=f6XE8sN+/ZaE4EVo3LoqvyV34gYjQjf9kkNfzb6d0JQ=; h=Cc:Date:From:Reply-To:Subject:To; b=HgTfn9OvTvjFvYZ/kbpuhfgstRhC2/wFn5avTM3MzIrmH+n6OputXTMfLSTiWw7khl1 FAk0ABdFavnvQW2TlRI7MubUk+jSzfVy9TvEq+QuGO/DGNbLFxjmJblOTEY1stqTjx6Aq aEh7m0pQDy21+fIvS4UyBp54RaZN7J+XXlA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jason Voelz Add code to set SMXE in CR4 in the SmxInitialize flow when SMX is enabled. Signed-off-by: Jason Voelz Cc: Ray Ni Reviewed-by: Ray Ni --- UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c b/Uef= iCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c index 38d3f53f56..b4474d2fab 100644 --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/FeatureControl.c @@ -240,6 +240,15 @@ SmxInitialize ( Status =3D RETURN_UNSUPPORTED; } =20 + CPU_REGISTER_TABLE_WRITE_FIELD ( + ProcessorNumber, + ControlRegister, + 4, + IA32_CR4, + Bits.SMXE, + (State) ? 1 : 0 + ) + CPU_REGISTER_TABLE_TEST_THEN_WRITE_FIELD ( ProcessorNumber, Msr, --=20 2.13.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52495): https://edk2.groups.io/g/devel/message/52495 Mute This Topic: https://groups.io/mt/69226211/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-