[PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable


Lendacky, Thomas
 

From: Tom Lendacky <thomas.lendacky@...>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2901

The DoDecrement variable in ApWakeupFunction () wasn't always being
initialized. Update the code to always fully initialize it.

Cc: Eric Dong <eric.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Rahul Kumar <rahul1.kumar@...>
Signed-off-by: Tom Lendacky <thomas.lendacky@...>
---
UefiCpuPkg/Library/MpInitLib/MpLib.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 90416c81b616..07426274f639 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -885,9 +885,7 @@ ApWakeupFunction (
UINT64 Status;
BOOLEAN DoDecrement;

- if (CpuMpData->InitFlag == ApInitConfig) {
- DoDecrement = TRUE;
- }
+ DoDecrement = (BOOLEAN) (CpuMpData->InitFlag == ApInitConfig);

while (TRUE) {
Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
--
2.28.0

Join {devel@edk2.groups.io to automatically receive all group messages.