public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, eric.dong@intel.com
Cc: Ray Ni <ray.ni@intel.com>, Chandana Kumar <chandana.c.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 2/2] UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI.
Date: Fri, 24 Apr 2020 18:39:35 +0200	[thread overview]
Message-ID: <982a9bf3-6fc2-2a47-9730-aa5c6f7a1129@redhat.com> (raw)
In-Reply-To: <20200422090111.423-2-eric.dong@intel.com>

On 04/22/20 11:01, Dong, Eric wrote:
> From: "Dong, Eric" <eric.dong@intel.com>
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2683
> 
> In PEI phase, AP already been waked up through ApInitConfig,
> so it can directly wake up it through change wakup buffer
> instead of use ApInitReconfig flag. It can save some time.
> 
> Change code to only use ApInitReconfig flag in DXE phase
> which must need to update the wake up buffer.
> 
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Chandana Kumar <chandana.c.kumar@intel.com>
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> ---
> V2:
> 1. Enhance code to remove CpuMpData->ApLoopMode == ApInHltLoop check.
> 
>  UefiCpuPkg/Library/MpInitLib/MpLib.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index 2e87aa1f06..6d3a0ccc72 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -1818,7 +1818,14 @@ MpInitLibInitialize (
>    // Wakeup APs to do some AP initialize sync (Microcode & MTRR)
>    //
>    if (CpuMpData->CpuCount > 1) {
> -    CpuMpData->InitFlag = ApInitReconfig;
> +    if (OldCpuMpData != NULL) {
> +      //
> +      // Only needs to use this flag for DXE phase to update the wake up
> +      // buffer. Wakeup buffer allocated in PEI phase is no longer valid
> +      // in DXE.
> +      //
> +      CpuMpData->InitFlag = ApInitReconfig;
> +    }
>      WakeUpAP (CpuMpData, TRUE, 0, ApInitializeSync, CpuMpData, TRUE);
>      //
>      // Wait for all APs finished initialization
> @@ -1826,7 +1833,9 @@ MpInitLibInitialize (
>      while (CpuMpData->FinishedCount < (CpuMpData->CpuCount - 1)) {
>        CpuPause ();
>      }
> -    CpuMpData->InitFlag = ApInitDone;
> +    if (OldCpuMpData != NULL) {
> +      CpuMpData->InitFlag = ApInitDone;
> +    }
>      for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
>        SetApState (&CpuMpData->CpuData[Index], CpuStateIdle);
>      }
> 

Hm. The only feedback I could provide for this patch is a regression
test result. However, seeing how Ray has outstanding questions for this
patch, I think I'll delay my testing to the next version (or do it later
for this version, if Ray is ultimately OK with it).

Thanks
Laszlo


  parent reply	other threads:[~2020-04-24 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  9:01 [PATCH v2 1/2] UefiCpuPkg/MpInitLib: Restore IDT context for APs Dong, Eric
2020-04-22  9:01 ` [PATCH v2 2/2] UefiCpuPkg/MpInitLib: Avoid ApInitReconfig in PEI Dong, Eric
2020-04-22 11:23   ` Ni, Ray
2020-04-24 16:39   ` Laszlo Ersek [this message]
2020-04-22 11:47 ` [PATCH v2 1/2] UefiCpuPkg/MpInitLib: Restore IDT context for APs Ni, Ray
2020-04-24 16:37   ` [edk2-devel] " Laszlo Ersek
2020-04-22 21:41 ` Laszlo Ersek
2020-04-23  0:58   ` Dong, Eric
2020-04-24 16:37 ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=982a9bf3-6fc2-2a47-9730-aa5c6f7a1129@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox