public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Xie, Yuanhao" <yuanhao.xie@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	"Dong, Eric" <eric.dong@intel.com>,
	"Kumar, Rahul R" <rahul.r.kumar@intel.com>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [Patch V3 1/5] UefiCpuPkg: Refactor the logic for placing APs in HltLoop.
Date: Mon, 26 Jun 2023 09:10:15 +0000	[thread overview]
Message-ID: <MN6PR11MB82440311E9C95603EBE8B7F58C26A@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230626055705.57145-2-yuanhao.xie@intel.com>

Reviewed-by: Ray Ni <ray.ni@intel.com>

> -----Original Message-----
> From: Xie, Yuanhao <yuanhao.xie@intel.com>
> Sent: Monday, June 26, 2023 1:57 PM
> To: devel@edk2.groups.io
> Cc: Gerd Hoffmann <kraxel@redhat.com>; Dong, Eric <eric.dong@intel.com>; Ni,
> Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Tom
> Lendacky <thomas.lendacky@amd.com>; Xie, Yuanhao
> <yuanhao.xie@intel.com>
> Subject: [Patch V3 1/5] UefiCpuPkg: Refactor the logic for placing APs in HltLoop.
> 
> Refactor the logic for placing APs in HltLoop into a separate function.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
> ---
>  UefiCpuPkg/Library/MpInitLib/MpLib.c | 35 ++++++++++++++++++++++++-------
> ----
>  1 file changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> index f1f2840714..9560b39220 100644
> --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
> +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
> @@ -636,6 +636,28 @@ InitializeApData (
>    SetApState (&CpuMpData->CpuData[ProcessorNumber], CpuStateIdle);
>  }
> 
> +/**
> +  This function place APs in Halt loop.
> +
> +  @param[in] CpuMpData        Pointer to CPU MP Data
> +**/
> +VOID
> +PlaceAPInHltLoop (
> +  IN CPU_MP_DATA  *CpuMpData
> +  )
> +{
> +  while (TRUE) {
> +    DisableInterrupts ();
> +    if (CpuMpData->UseSevEsAPMethod) {
> +      SevEsPlaceApHlt (CpuMpData);
> +    } else {
> +      CpuSleep ();
> +    }
> +
> +    CpuPause ();
> +  }
> +}
> +
>  /**
>    This function will be called from AP reset code if BSP uses WakeUpAP.
> 
> @@ -812,19 +834,10 @@ ApWakeupFunction (
>      // Place AP is specified loop mode
>      //
>      if (CpuMpData->ApLoopMode == ApInHltLoop) {
> +      PlaceAPInHltLoop (CpuMpData);
>        //
> -      // Place AP in HLT-loop
> +      // Never run here
>        //
> -      while (TRUE) {
> -        DisableInterrupts ();
> -        if (CpuMpData->UseSevEsAPMethod) {
> -          SevEsPlaceApHlt (CpuMpData);
> -        } else {
> -          CpuSleep ();
> -        }
> -
> -        CpuPause ();
> -      }
>      }
> 
>      while (TRUE) {
> --
> 2.36.1.windows.1


  reply	other threads:[~2023-06-26  9:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26  5:57 [Patch V3 0/5] Eliminate the second INIT-SIPI-SIPI sequence Yuanhao Xie
2023-06-26  5:57 ` [Patch V3 1/5] UefiCpuPkg: Refactor the logic for placing APs in HltLoop Yuanhao Xie
2023-06-26  9:10   ` Ni, Ray [this message]
2023-06-26  5:57 ` [Patch V3 2/5] UefiCpuPkg: Refactor the logic for placing APs in Mwait/Runloop Yuanhao Xie
2023-06-26  9:10   ` Ni, Ray
2023-06-26  5:57 ` [Patch V3 3/5] UefiCpuPkg: Create MpHandOff Yuanhao Xie
2023-06-26  9:28   ` Ni, Ray
2023-06-28  8:57     ` Yuanhao Xie
2023-06-26  5:57 ` [Patch V3 4/5] UefiCpuPkg: ApWakeupFunction directly use CpuMpData Yuanhao Xie
2023-06-26  9:36   ` Ni, Ray
2023-06-26  5:57 ` [Patch V3 5/5] UefiCpuPkg: Eliminate the second INIT-SIPI-SIPI sequence Yuanhao Xie
2023-06-27  5:51   ` Ni, Ray
2023-06-28  8:52     ` Yuanhao Xie

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=MN6PR11MB82440311E9C95603EBE8B7F58C26A@MN6PR11MB8244.namprd11.prod.outlook.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