68 lines
2.1 KiB
Diff
68 lines
2.1 KiB
Diff
From 364b11a2cc6c37ce66af2bbeb70591f98d8b14d2 Mon Sep 17 00:00:00 2001
|
|
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Date: Thu, 22 Feb 2024 17:01:06 +0100
|
|
Subject: [PATCH 10/10] UefiCpuPkg/MpInitLib: return early in GetBspNumber()
|
|
|
|
RH-Author: Gerd Hoffmann <None>
|
|
RH-MergeRequest: 59: backport 4096 vcpu patches for c9s
|
|
RH-Jira: RHEL-22202
|
|
RH-Acked-by: Oliver Steffen <osteffen@redhat.com>
|
|
RH-Commit: [10/10] 0695e52ad712025a0cfb097926dcf14a498664ae (kraxel.rh/centos-src-edk2)
|
|
|
|
After finding the BSP Number return the result instead of
|
|
continuing to loop over the remaining processors.
|
|
|
|
Suggested-by: Laszlo Ersek <lersek@redhat.com>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Message-Id: <20240222160106.686484-7-kraxel@redhat.com>
|
|
Reviewed-by: Ray Ni <ray.ni@intel.com>
|
|
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
[lersek@redhat.com: s/ASSERT (FALSE)/ASSERT_EFI_ERROR (EFI_NOT_FOUND)/ [Ray]]
|
|
(cherry picked from commit d25421d0d8cd2493b30215ef80d2424ecb19c870)
|
|
---
|
|
UefiCpuPkg/Library/MpInitLib/MpLib.c | 11 ++++-------
|
|
1 file changed, 4 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
|
|
index a50981c9d1..b408585fcc 100644
|
|
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
|
|
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
|
|
@@ -1909,15 +1909,13 @@ GetBspNumber (
|
|
)
|
|
{
|
|
UINT32 ApicId;
|
|
- UINT32 BspNumber;
|
|
UINT32 Index;
|
|
CONST MP_HAND_OFF *MpHandOff;
|
|
|
|
//
|
|
// Get the processor number for the BSP
|
|
//
|
|
- BspNumber = MAX_UINT32;
|
|
- ApicId = GetInitialApicId ();
|
|
+ ApicId = GetInitialApicId ();
|
|
|
|
for (MpHandOff = FirstMpHandOff;
|
|
MpHandOff != NULL;
|
|
@@ -1925,14 +1923,13 @@ GetBspNumber (
|
|
{
|
|
for (Index = 0; Index < MpHandOff->CpuCount; Index++) {
|
|
if (MpHandOff->Info[Index].ApicId == ApicId) {
|
|
- BspNumber = MpHandOff->ProcessorIndex + Index;
|
|
+ return MpHandOff->ProcessorIndex + Index;
|
|
}
|
|
}
|
|
}
|
|
|
|
- ASSERT (BspNumber != MAX_UINT32);
|
|
-
|
|
- return BspNumber;
|
|
+ ASSERT_EFI_ERROR (EFI_NOT_FOUND);
|
|
+ return 0;
|
|
}
|
|
|
|
/**
|
|
--
|
|
2.39.3
|
|
|