public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ankur.a.arora@oracle.com
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdePkg: use CpuPause() in CpuDeadLoop()
Date: Wed, 17 Mar 2021 19:30:55 +0100	[thread overview]
Message-ID: <2212bc34-f8b5-fd65-aa2e-c91b7b97915c@redhat.com> (raw)
In-Reply-To: <20210316225918.2625938-1-ankur.a.arora@oracle.com>

On 03/16/21 23:59, Ankur Arora wrote:
> Use CpuPause() to allow the CPU to go into a lower power state
> state while we spin wait.
> 
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> ---
>  MdePkg/Library/BaseLib/CpuDeadLoop.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseLib/CpuDeadLoop.c b/MdePkg/Library/BaseLib/CpuDeadLoop.c
> index 9e110cacbc96..3cd304351a65 100644
> --- a/MdePkg/Library/BaseLib/CpuDeadLoop.c
> +++ b/MdePkg/Library/BaseLib/CpuDeadLoop.c
> @@ -28,5 +28,7 @@ CpuDeadLoop (
>  {
>    volatile UINTN  Index;
>  
> -  for (Index = 0; Index == 0;);
> +  for (Index = 0; Index == 0;) {
> +    CpuPause();
> +  }
>  }
> 

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

(for RISC-V and ARM64, the implementations seem to be "nop" instructions)

Thanks
Laszlo


      parent reply	other threads:[~2021-03-17 18:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 22:59 [PATCH] MdePkg: use CpuPause() in CpuDeadLoop() Ankur Arora
2021-03-17  1:08 ` 回复: " gaoliming
2021-03-17  3:54   ` Ankur Arora
2021-03-17 18:30 ` Laszlo Ersek [this message]

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=2212bc34-f8b5-fd65-aa2e-c91b7b97915c@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