/* If PcdCpuFeaturesInitAfterSmmRelocation is TRUE, it will register one SMM Configuration Protocol notify function to perform CPU features initialization. Otherwise, it will perform CPU features initialization directly. */
EFI_STATUS EFIAPI CpuFeaturesDxeInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
/* If PcdCpuFeaturesInitAfterSmmRelocation is TRUE, it will register one SMM Configuration Protocol notify function to perform CPU features initialization. Otherwise, it will perform CPU features initialization directly. */
EFI_STATUS EFIAPI CpuFeaturesDxeInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
  VOID        *Registration;
  EFI_STATUS  Status;
  EFI_HANDLE  Handle;
  if (GetFirstGuidHob (&gEdkiiCpuFeaturesInitDoneGuid) != NULL) {
    Handle = NULL;
    Status = gBS->InstallProtocolInterface (
                    &Handle,
                    &gEdkiiCpuFeaturesInitDoneGuid,
                    EFI_NATIVE_INTERFACE,
                    NULL
                    );
    ASSERT_EFI_ERROR (Status);
    return Status;
  }
  if (PcdGetBool (PcdCpuFeaturesInitAfterSmmRelocation)) {
    EfiCreateProtocolNotifyEvent (
      &gEfiSmmConfigurationProtocolGuid,
      TPL_CALLBACK,
      SmmConfigurationEventNotify,
      NULL,
      &Registration
      );
  } else {
    CpuFeaturesInitializeWorker ();
  }
  return EFI_SUCCESS;
}