summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2017-10-26 10:28:23 +0800
committerEric Dong <eric.dong@intel.com>2017-10-27 09:34:37 +0800
commitbf5a306ab5e0b1829b1d59180bc010648f09a32e (patch)
treefcec62404f8e95c44e0ba9e65ae207996f6389d5 /UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c
parentc0cbaaf69348e8c389dc31f696857e25424b408b (diff)
downloadedk2-bf5a306ab5e0b1829b1d59180bc010648f09a32e.tar.gz
edk2-bf5a306ab5e0b1829b1d59180bc010648f09a32e.tar.bz2
edk2-bf5a306ab5e0b1829b1d59180bc010648f09a32e.zip
UefiCpuPkg/CpuFeatures: Export HOB if CPU initialized in PEI
In current implementation, CPU initialized can be done in PEI or DXE phase. PEI uses CpuFeaturesPei and Dxe uses CpuFeaturesDxe. If CPU initialized in PEI phase, CpuFeaturesDxe driver will not be used. This driver will install gEdkiiCpuFeaturesInitDoneGuid protocol after it initializes the CPU. Some drivers depend on this protocol to dispatch themselves. If CpuFeaturesDxe not been used, these drivers will not be dispatched. This patch fix the above issue. If Cpu initialized in PEI phase, it also report a guid HOB for CpuFeaturesDxe. CpuFeaturesDxe will check this HOB first. If it found this HOB, it just install gEdkiiCpuFeaturesInitDoneGuid protocol, else it will also do the CPU initialization. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c')
-rw-r--r--UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c b/UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c
index b052d554a9..72ee19b450 100644
--- a/UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c
+++ b/UefiCpuPkg/CpuFeatures/CpuFeaturesPei.c
@@ -18,6 +18,7 @@
#include <Library/DebugLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/RegisterCpuFeaturesLib.h>
+#include <Library/HobLib.h>
#include <Guid/CpuFeaturesInitDone.h>
@@ -70,6 +71,11 @@ CpuFeaturesPeimInitialize (
Status = PeiServicesInstallPpi(&mPeiCpuFeaturesInitDonePpiDesc);
ASSERT_EFI_ERROR (Status);
+ //
+ // Build HOB to let CpuFeatureDxe driver skip the initialization process.
+ //
+ BuildGuidHob (&gEdkiiCpuFeaturesInitDoneGuid, 0);
+
return EFI_SUCCESS;
}