public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
@ 2020-08-20 14:53 Lendacky, Thomas
  2020-08-21  0:38 ` [edk2-devel] " Dong, Eric
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Lendacky, Thomas @ 2020-08-20 14:53 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..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


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

* Re: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
  2020-08-20 14:53 [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable Lendacky, Thomas
@ 2020-08-21  0:38 ` Dong, Eric
  2020-08-21  1:16   ` Liming Gao
  2020-08-21 10:52 ` Laszlo Ersek
  2020-08-24 19:13 ` [edk2-devel] " Laszlo Ersek
  2 siblings, 1 reply; 5+ messages in thread
From: Dong, Eric @ 2020-08-21  0:38 UTC (permalink / raw)
  To: devel@edk2.groups.io, thomas.lendacky@amd.com
  Cc: Gao, Liming, Ni, Ray, Laszlo Ersek, Kumar, Rahul1

Reviewed-by: Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
> Lendacky, Thomas
> Sent: Thursday, August 20, 2020 10:53 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Dong, Eric <eric.dong@intel.com>;
> Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar,
> Rahul1 <rahul1.kumar@intel.com>
> Subject: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize
> the DoDecrement variable
> 
> 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..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
> 
> 
> 


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

* Re: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
  2020-08-21  0:38 ` [edk2-devel] " Dong, Eric
@ 2020-08-21  1:16   ` Liming Gao
  0 siblings, 0 replies; 5+ messages in thread
From: Liming Gao @ 2020-08-21  1:16 UTC (permalink / raw)
  To: Dong, Eric, devel@edk2.groups.io, thomas.lendacky@amd.com
  Cc: Ni, Ray, Laszlo Ersek, Kumar, Rahul1

Tested-by: Liming Gao <liming.gao@intel.com>

-----Original Message-----
From: Dong, Eric <eric.dong@intel.com> 
Sent: 2020年8月21日 8:39
To: devel@edk2.groups.io; thomas.lendacky@amd.com
Cc: Gao, Liming <liming.gao@intel.com>; Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Kumar, Rahul1 <rahul1.kumar@intel.com>
Subject: RE: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable

Reviewed-by: Eric Dong <eric.dong@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of 
> Lendacky, Thomas
> Sent: Thursday, August 20, 2020 10:53 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Dong, Eric 
> <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Laszlo Ersek 
> <lersek@redhat.com>; Kumar,
> Rahul1 <rahul1.kumar@intel.com>
> Subject: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always 
> initialize the DoDecrement variable
> 
> 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..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
> 
> 
> 


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

* Re: [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
  2020-08-20 14:53 [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable Lendacky, Thomas
  2020-08-21  0:38 ` [edk2-devel] " Dong, Eric
@ 2020-08-21 10:52 ` Laszlo Ersek
  2020-08-24 19:13 ` [edk2-devel] " Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-08-21 10:52 UTC (permalink / raw)
  To: Tom Lendacky, devel; +Cc: Liming Gao, Eric Dong, Ray Ni, Rahul Kumar

On 08/20/20 16:53, Tom Lendacky wrote:
> 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..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);
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo


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

* Re: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable
  2020-08-20 14:53 [PATCH v2 1/1] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable Lendacky, Thomas
  2020-08-21  0:38 ` [edk2-devel] " Dong, Eric
  2020-08-21 10:52 ` Laszlo Ersek
@ 2020-08-24 19:13 ` Laszlo Ersek
  2 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2020-08-24 19:13 UTC (permalink / raw)
  To: devel, thomas.lendacky; +Cc: Liming Gao, Eric Dong, Ray Ni, Rahul Kumar

On 08/20/20 16:53, Lendacky, Thomas wrote:
> 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..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);
> 

Merged as commit 48a83481d2a2, via
<https://github.com/tianocore/edk2/pull/900>.

Thanks
Laszlo


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

end of thread, other threads:[~2020-08-24 19:13 UTC | newest]

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

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