mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 14:44:28 +02:00
UefiCpuPkg/PiSmmCpuDxeSmm: Add GetSupportedMaxLogicalProcessorNumber
MM CPU can not use the dynamic PCD (PcdCpuMaxLogicalProcessorNumber), so move the PCD usage to DxeSmm. 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
167e902624
commit
7b9b4ed57f
@ -652,15 +652,17 @@ GetMpInformation (
|
|||||||
GuidHob = GetNextGuidHob (&gMpInformation2HobGuid, GET_NEXT_HOB (GuidHob));
|
GuidHob = GetNextGuidHob (&gMpInformation2HobGuid, GET_NEXT_HOB (GuidHob));
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT (*NumberOfCpus <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
|
*MaxNumberOfCpus = *NumberOfCpus;
|
||||||
|
|
||||||
|
if (!mIsStandaloneMm) {
|
||||||
|
ASSERT (*NumberOfCpus <= GetSupportedMaxLogicalProcessorNumber ());
|
||||||
|
|
||||||
//
|
//
|
||||||
// If support CPU hot plug, we need to allocate resources for possibly hot-added processors
|
// If support CPU hot plug, we need to allocate resources for possibly hot-added processors
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdCpuHotPlugSupport)) {
|
if (FeaturePcdGet (PcdCpuHotPlugSupport)) {
|
||||||
*MaxNumberOfCpus = PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
|
*MaxNumberOfCpus = GetSupportedMaxLogicalProcessorNumber ();
|
||||||
} else {
|
}
|
||||||
*MaxNumberOfCpus = *NumberOfCpus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MpInfo2Hobs = AllocatePool (sizeof (MP_INFORMATION2_HOB_DATA *) * HobCount);
|
MpInfo2Hobs = AllocatePool (sizeof (MP_INFORMATION2_HOB_DATA *) * HobCount);
|
||||||
|
@ -1558,6 +1558,17 @@ SmmWriteProtectReadOnlyPage (
|
|||||||
} \
|
} \
|
||||||
} while (FALSE)
|
} while (FALSE)
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the maximum number of logical processors supported by the system.
|
||||||
|
|
||||||
|
@retval The maximum number of logical processors supported by the system
|
||||||
|
is indicated by the return value.
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
GetSupportedMaxLogicalProcessorNumber (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from gEfiMpServiceProtocolGuid.
|
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from gEfiMpServiceProtocolGuid.
|
||||||
|
|
||||||
|
@ -121,6 +121,20 @@ GetAcpiS3EnableFlag (
|
|||||||
mAcpiS3Enable = PcdGetBool (PcdAcpiS3Enable);
|
mAcpiS3Enable = PcdGetBool (PcdAcpiS3Enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the maximum number of logical processors supported by the system.
|
||||||
|
|
||||||
|
@retval The maximum number of logical processors supported by the system
|
||||||
|
is indicated by the return value.
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
GetSupportedMaxLogicalProcessorNumber (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from gEfiMpServiceProtocolGuid.
|
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION for all CPU from gEfiMpServiceProtocolGuid.
|
||||||
|
|
||||||
@ -165,7 +179,7 @@ GetMpInformationFromMpServices (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT (NumberOfProcessors <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
|
ASSERT (NumberOfProcessors <= GetSupportedMaxLogicalProcessorNumber ());
|
||||||
|
|
||||||
/// Allocate buffer for processor information
|
/// Allocate buffer for processor information
|
||||||
ProcessorInfo = AllocateZeroPool (sizeof (EFI_PROCESSOR_INFORMATION) * NumberOfProcessors);
|
ProcessorInfo = AllocateZeroPool (sizeof (EFI_PROCESSOR_INFORMATION) * NumberOfProcessors);
|
||||||
@ -187,12 +201,12 @@ GetMpInformationFromMpServices (
|
|||||||
|
|
||||||
*NumberOfCpus = NumberOfEnabledProcessors;
|
*NumberOfCpus = NumberOfEnabledProcessors;
|
||||||
|
|
||||||
ASSERT (*NumberOfCpus <= PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
|
ASSERT (*NumberOfCpus <= GetSupportedMaxLogicalProcessorNumber ());
|
||||||
//
|
//
|
||||||
// If support CPU hot plug, we need to allocate resources for possibly hot-added processors
|
// If support CPU hot plug, we need to allocate resources for possibly hot-added processors
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdCpuHotPlugSupport)) {
|
if (FeaturePcdGet (PcdCpuHotPlugSupport)) {
|
||||||
*MaxNumberOfCpus = PcdGet32 (PcdCpuMaxLogicalProcessorNumber);
|
*MaxNumberOfCpus = GetSupportedMaxLogicalProcessorNumber ();
|
||||||
} else {
|
} else {
|
||||||
*MaxNumberOfCpus = *NumberOfCpus;
|
*MaxNumberOfCpus = *NumberOfCpus;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,22 @@ GetAcpiS3EnableFlag (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the maximum number of logical processors supported by the system.
|
||||||
|
|
||||||
|
@retval The maximum number of logical processors supported by the system
|
||||||
|
is indicated by the return value.
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
GetSupportedMaxLogicalProcessorNumber (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ASSERT (FALSE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION.
|
Extract NumberOfCpus, MaxNumberOfCpus and EFI_PROCESSOR_INFORMATION.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user