X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=UefiCpuPkg%2FCpuFeatures%2FCpuFeaturesDxe.c;fp=UefiCpuPkg%2FCpuFeatures%2FCpuFeaturesDxe.c;h=16c8f37fd04a2c3238f6c88429a2a0d9413573b0;hb=bf5a306ab5e0b1829b1d59180bc010648f09a32e;hp=b0b186d36d6d4e2affe24db47bc14130b6648490;hpb=c0cbaaf69348e8c389dc31f696857e25424b408b;p=mirror_edk2.git diff --git a/UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c b/UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c index b0b186d36d..16c8f37fd0 100644 --- a/UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c +++ b/UefiCpuPkg/CpuFeatures/CpuFeaturesDxe.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,25 @@ CpuFeaturesDxeInitialize ( ) { VOID *Registration; + EFI_STATUS Status; + EFI_HANDLE Handle; + + if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) { + // + // Try to find HOB first. This HOB exist means CPU features have + // been initialized by CpuFeaturesPei driver, just install + // gEdkiiCpuFeaturesInitDoneGuid. + // + Handle = NULL; + Status = gBS->InstallProtocolInterface ( + &Handle, + &gEdkiiCpuFeaturesInitDoneGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); + return Status; + } if (PcdGetBool (PcdCpuFeaturesInitAfterSmmRelocation)) { //