summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PlatformPei
diff options
context:
space:
mode:
authorMin Xu <min.m.xu@intel.com>2022-03-06 21:40:28 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-02 08:15:12 +0000
commit432e4acd8751c4ea37dd6eb41924e6634e4dd761 (patch)
treeba830179845e175a4fbf44a626b0ffe83080495e /OvmfPkg/PlatformPei
parent3dd47f9544633f195c5b047cca2c38c2f079d6b5 (diff)
downloadedk2-432e4acd8751c4ea37dd6eb41924e6634e4dd761.tar.gz
edk2-432e4acd8751c4ea37dd6eb41924e6634e4dd761.tar.bz2
edk2-432e4acd8751c4ea37dd6eb41924e6634e4dd761.zip
OvmfPkg/PlatformPei: Refactor MaxCpuCountInitialization
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3863 MaxCpuCountInitialization is splitted into two: - PlatformMaxCpuCountInitialization is for PlatformInitLib - MaxCpuCountInitialization is for PlatformPei. It calls PlatformMaxCpuCountInitialization then sets PCDs. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Sebastien Boeuf <sebastien.boeuf@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'OvmfPkg/PlatformPei')
-rw-r--r--OvmfPkg/PlatformPei/Platform.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 7d370c9b8f..20e38a098d 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -539,16 +539,15 @@ Q35BoardVerification (
/**
Fetch the boot CPU count and the possible CPU count from QEMU, and expose
- them to UefiCpuPkg modules. Set the mMaxCpuCount variable.
+ them to UefiCpuPkg modules. Set the MaxCpuCount field in PlatformInfoHob.
**/
VOID
-MaxCpuCountInitialization (
+PlatformMaxCpuCountInitialization (
IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
)
{
- UINT16 BootCpuCount;
- UINT32 MaxCpuCount;
- RETURN_STATUS PcdStatus;
+ UINT16 BootCpuCount;
+ UINT32 MaxCpuCount;
//
// Try to fetch the boot CPU count.
@@ -705,16 +704,30 @@ MaxCpuCountInitialization (
));
ASSERT (BootCpuCount <= MaxCpuCount);
- PcdStatus = PcdSet32S (PcdCpuBootLogicalProcessorNumber, BootCpuCount);
- ASSERT_RETURN_ERROR (PcdStatus);
- PcdStatus = PcdSet32S (PcdCpuMaxLogicalProcessorNumber, MaxCpuCount);
- ASSERT_RETURN_ERROR (PcdStatus);
-
PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber = MaxCpuCount;
PlatformInfoHob->PcdCpuBootLogicalProcessorNumber = BootCpuCount;
}
/**
+ Fetch the boot CPU count and the possible CPU count from QEMU, and expose
+ them to UefiCpuPkg modules. Set the MaxCpuCount field in PlatformInfoHob.
+**/
+VOID
+MaxCpuCountInitialization (
+ IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob
+ )
+{
+ RETURN_STATUS PcdStatus;
+
+ PlatformMaxCpuCountInitialization (PlatformInfoHob);
+
+ PcdStatus = PcdSet32S (PcdCpuBootLogicalProcessorNumber, PlatformInfoHob->PcdCpuBootLogicalProcessorNumber);
+ ASSERT_RETURN_ERROR (PcdStatus);
+ PcdStatus = PcdSet32S (PcdCpuMaxLogicalProcessorNumber, PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber);
+ ASSERT_RETURN_ERROR (PcdStatus);
+}
+
+/**
Perform Platform PEI initialization.
@param FileHandle Handle of the file being invoked.