UefiCpuPkg/PiSmmCpuDxeSmm: Define mIsStandaloneMm to indicate SMM or MM
Define the mIsStandaloneMm to indicate it's the MM_STANDALONE MM CPU driver or DXE_SMM_DRIVER SMM CPU driver execution. With mIsStandaloneMm, GetMpInformationFromMpServices() can be skipped for the MM CPU since it can not call the GetMpInformationFromMpServices() due to the NON-SMM MP Services usage for the MP Information. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Dun Tan <dun.tan@intel.com> Cc: Hongbin1 Zhang <hongbin1.zhang@intel.com> Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Yuanhao Xie <yuanhao.xie@intel.com>
This commit is contained in:
parent
5f88a44637
commit
9ee5334796
|
@ -625,10 +625,15 @@ GetMpInformation (
|
||||||
HobCount = 0;
|
HobCount = 0;
|
||||||
|
|
||||||
FirstMpInfo2Hob = GetFirstGuidHob (&gMpInformation2HobGuid);
|
FirstMpInfo2Hob = GetFirstGuidHob (&gMpInformation2HobGuid);
|
||||||
|
|
||||||
|
if (mIsStandaloneMm) {
|
||||||
|
ASSERT (FirstMpInfo2Hob != NULL);
|
||||||
|
} else {
|
||||||
if (FirstMpInfo2Hob == NULL) {
|
if (FirstMpInfo2Hob == NULL) {
|
||||||
DEBUG ((DEBUG_INFO, "%a: [INFO] gMpInformation2HobGuid HOB not found.\n", __func__));
|
DEBUG ((DEBUG_INFO, "%a: [INFO] gMpInformation2HobGuid HOB not found.\n", __func__));
|
||||||
return GetMpInformationFromMpServices (NumberOfCpus, MaxNumberOfCpus);
|
return GetMpInformationFromMpServices (NumberOfCpus, MaxNumberOfCpus);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GuidHob = FirstMpInfo2Hob;
|
GuidHob = FirstMpInfo2Hob;
|
||||||
while (GuidHob != NULL) {
|
while (GuidHob != NULL) {
|
||||||
|
|
|
@ -253,6 +253,8 @@ typedef struct {
|
||||||
LIST_ENTRY *FirstFreeToken;
|
LIST_ENTRY *FirstFreeToken;
|
||||||
} SMM_CPU_PRIVATE_DATA;
|
} SMM_CPU_PRIVATE_DATA;
|
||||||
|
|
||||||
|
extern const BOOLEAN mIsStandaloneMm;
|
||||||
|
|
||||||
extern SMM_CPU_PRIVATE_DATA *gSmmCpuPrivate;
|
extern SMM_CPU_PRIVATE_DATA *gSmmCpuPrivate;
|
||||||
extern CPU_HOT_PLUG_DATA mCpuHotPlugData;
|
extern CPU_HOT_PLUG_DATA mCpuHotPlugData;
|
||||||
extern UINTN mMaxNumberOfCpus;
|
extern UINTN mMaxNumberOfCpus;
|
||||||
|
|
|
@ -12,6 +12,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
#include "PiSmmCpuCommon.h"
|
#include "PiSmmCpuCommon.h"
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
// TRUE to indicate it's the MM_STANDALONE MM CPU driver.
|
||||||
|
// FALSE to indicate it's the DXE_SMM_DRIVER SMM CPU driver.
|
||||||
|
//
|
||||||
|
const BOOLEAN mIsStandaloneMm = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
To get system port address of the SMI Command Port in FADT table.
|
To get system port address of the SMI Command Port in FADT table.
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
#include "PiSmmCpuCommon.h"
|
#include "PiSmmCpuCommon.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// TRUE to indicate it's the MM_STANDALONE MM CPU driver.
|
||||||
|
// FALSE to indicate it's the DXE_SMM_DRIVER SMM CPU driver.
|
||||||
|
//
|
||||||
|
const BOOLEAN mIsStandaloneMm = TRUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
To get system port address of the SMI Command Port.
|
To get system port address of the SMI Command Port.
|
||||||
|
|
||||||
|
@ -94,3 +100,22 @@ GetAcpiS3EnableFlag (
|
||||||
mAcpiS3Enable = MmAcpiS3EnableHob->AcpiS3Enable;
|
mAcpiS3Enable = MmAcpiS3EnableHob->AcpiS3Enable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION.
|
||||||
|
|
||||||
|
@param[out] NumberOfCpus Pointer to NumberOfCpus.
|
||||||
|
@param[out] MaxNumberOfCpus Pointer to MaxNumberOfCpus.
|
||||||
|
|
||||||
|
@retval ProcessorInfo Pointer to EFI_PROCESSOR_INFORMATION buffer.
|
||||||
|
**/
|
||||||
|
EFI_PROCESSOR_INFORMATION *
|
||||||
|
GetMpInformationFromMpServices (
|
||||||
|
OUT UINTN *NumberOfCpus,
|
||||||
|
OUT UINTN *MaxNumberOfCpus
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue