summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
Commit message (Collapse)AuthorAgeFilesLines
* UefiCpuPkg/SmmCpuFeaturesLib: Skip SMBASE configurationWu, Jiaxin2023-03-061-1/+5
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4337 This patch is to avoid configure SMBASE if SmBase relocation has been done. If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. No need to do the relocation in SmmCpuFeaturesInitializeProcessor(). Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zeng Star <star.zeng@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Abstract arch dependent codeAbner Chang2022-11-021-0/+1
| | | | | | | | | | | | | | | | | | | | BZ# 4093: Abstract SmmCpuFeaturesLib for sharing common code This change stripped away the code that can be shared with other archs or vendors from Intel implementation and put in to the common file, leaves the Intel X86 implementation in the IntelSmmCpuFeatureLib. Also updates the header file and INF file. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Abdul Lateef Attar <abdattar@amd.com> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com> Cc: Paul Grimes <paul.grimes@amd.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Rename the common C fileAbner Chang2022-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | BZ# 4093: Abstract SmmCpuFeaturesLib for sharing common code Rename SmmCpuFeaturesLiCommon.c to IntelSmmCpuFeaturesLib, because it was developed specifically for Intel implementation. The code that can be shared by other archs or vendors will be stripped away and put in the common file in the next patch. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Abdul Lateef Attar <abdattar@amd.com> Cc: Garrett Kirkendall <garrett.kirkendall@amd.com> Cc: Paul Grimes <paul.grimes@amd.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiCpuPkg: Add PCD to control SMRR enable & SmmFeatureControl supportWu, Jiaxin2022-08-311-0/+4
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3962 Two SMM variables (mSmrrSupported & mSmmFeatureControlSupported) are global variables, they control whether the SMRR and SMM Feature Control MSR will be restored respectively. To avoid the TOCTOU, add PCD to control SMRR & SmmFeatureControl enable. Cc: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Abstract PcdCpuMaxLogicalProcessorNumberMichael Kubacki2021-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3218 Adds a new function called GetCpuMaxLogicalProcessorNumber() to return the number of maximum CPU logical processors (currently gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber). This allows the the mechanism used to retrieve the CPU maximum logical processor number to be abstracted from the logic that needs the value. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210217213227.1277-5-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructorsMichael Kubacki2021-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's currently two library instances: 1. SmmCpuFeaturesLib 2. SmmCpuFeaturesLibStm There's two constructor functions: 1. SmmCpuFeaturesLibConstructor() 2. SmmCpuFeaturesLibStmConstructor() SmmCpuFeaturesLibConstructor() is called by SmmCpuFeaturesLibStmConstructor() since the functionality in that function is required by both library instances. The declaration for SmmCpuFeaturesLibConstructor() is embedded in "SmmStm.c" instead of being declared in a header file. Further, that constructor function is called by the STM specific constructor. This change moves the common code to a function called CpuFeaturesLibInitialization() which is declared in an internal library header file "CpuFeaturesLib.h". Each constructor simply calls this function to perform the common functionality. Additionally, SmmCpuFeaturesLibConstructor() is moved from SmmCpuFeaturesLibNoStm.c into a instance-specific file allowing SmmCpuFeaturesLibNoStm.c to contain no STM implementation agnostic to a particular library instance. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210217213227.1277-4-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Rename SmmCpuFeaturesLib.cMichael Kubacki2021-03-081-1/+1
| | | | | | | | | | | | | | | This change renames SmmCpuFeaturesLib.c to SmmCpuFeaturesLibCommon.c to better convey that this file contains library implementation common to all library instances. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Message-Id: <20210217213227.1277-3-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Move multi-instance function decl to headerMichael Kubacki2021-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | FinishSmmCpuFeaturesInitializeProcessor() is a multi-instance internal library function that is currently not declared in a header file but embedded in "SmmCpuFeaturesLib.c". This change cleans up the declaration moving it to a new header file "CpuFeaturesLib.h" and removing the local declaration in "SmmCpuFeaturesLib.c". Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20210217213227.1277-2-mikuback@linux.microsoft.com> Reviewed-by: Eric Dong <eric.dong@intel.com> [lersek@redhat.com: replace the guard macro "_CPU_FEATURES_LIB_H_" with "CPU_FEATURES_LIB_H_", for fixing ECC 8003, per commit 6ffbb3581ab7]
* UefiCpuPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* UefiCpuPkg/SmmCpuFeaturesLib: Split into two filesMichael Kinney2016-12-191-1/+2
| | | | | | | | | | | | | | | | | | | | Split the default implementation of the SmmCpuFeaturesLib into two files to prepare for the addition of the STM specific SmmCpuFeaturesLib implementation. The STM specific implementation installs a different SMI entry handler and initialize the MSEG specific MSR at the end of SmmCpuFeaturesInitializeProcessor(). This patch does not introduce any functional changes to the default implementation of the SmmCpuFeaturesLib. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* UefiCpuPkg: Add SmmCpuFeaturesLibMichael Kinney2015-10-191-0/+39
Add SmmCpuFeaturesLib that provides CPU specific functions that are used to initialize SMM and process SMIs. A functional implementation of this library class is provided that is based on the Intel(R) 64 and IA-32 Architectures Software Developer's Manual [jeff.fan@intel.com: Fix code style issues reported by ECC] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18638 6f19259b-4bc3-4df7-8a09-765794883524