From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web09.1595.1616005868406402762 for ; Wed, 17 Mar 2021 11:31:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YR4TUSGy; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616005867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Q6/ttJNGC3Nspze2UP1NQZkKWwbKrnPmA2zwcfm4b8=; b=YR4TUSGylHHeehB7bLOM6PLHTScpicytVCEiWx5ko9NffitnmigDyWuBqWoEogut54q4bP EM42M1SnZdMEFuXm0NSnUhrUr9kNdvJ/BRjOoABFJMBlRlGyJeuw07R+Y6o07x/YPt68b7 jzu4TLvJelDxpndLeNpRZ+TrWskk4M0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-U7U-vdm_M16RRXXBRnpyFw-1; Wed, 17 Mar 2021 14:30:59 -0400 X-MC-Unique: U7U-vdm_M16RRXXBRnpyFw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3722C51DA; Wed, 17 Mar 2021 18:30:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-112.ams2.redhat.com [10.36.113.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F48D60864; Wed, 17 Mar 2021 18:30:56 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] MdePkg: use CpuPause() in CpuDeadLoop() To: devel@edk2.groups.io, ankur.a.arora@oracle.com Cc: Liming Gao , Michael D Kinney References: <20210316225918.2625938-1-ankur.a.arora@oracle.com> From: "Laszlo Ersek" Message-ID: <2212bc34-f8b5-fd65-aa2e-c91b7b97915c@redhat.com> Date: Wed, 17 Mar 2021 19:30:55 +0100 MIME-Version: 1.0 In-Reply-To: <20210316225918.2625938-1-ankur.a.arora@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 > Signed-off-by: Ankur Arora > Reviewed-by: Michael D Kinney > --- > 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 (for RISC-V and ARM64, the implementations seem to be "nop" instructions) Thanks Laszlo