public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
@ 2020-08-18 13:10 Lendacky, Thomas
  2020-08-19  7:08 ` Liming Gao
  2020-08-19  9:24 ` Laszlo Ersek
  0 siblings, 2 replies; 5+ messages in thread
From: Lendacky, Thomas @ 2020-08-18 13:10 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Eric Dong, Ray Ni, Laszlo Ersek, Rahul Kumar

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

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@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
---
 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..e24bdc64f930 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 = (CpuMpData->InitFlag == ApInitConfig) ? TRUE : FALSE;
 
           while (TRUE) {
             Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-20 14:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-18 13:10 [PATCH 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable Lendacky, Thomas
2020-08-19  7:08 ` Liming Gao
2020-08-20 14:52   ` Lendacky, Thomas
2020-08-19  9:24 ` Laszlo Ersek
2020-08-19 14:45   ` [edk2-devel] " Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox