From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 025BD81EA4 for ; Fri, 25 Nov 2016 03:09:40 -0800 (PST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 788BE64CE; Fri, 25 Nov 2016 11:09:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-35.phx2.redhat.com [10.3.116.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAPB9bON017027; Fri, 25 Nov 2016 06:09:38 -0500 To: Jeff Fan , edk2-devel@ml01.01.org References: <20161125060312.27932-1-jeff.fan@intel.com> <20161125060312.27932-5-jeff.fan@intel.com> Cc: Feng Tian , Michael D Kinney From: Laszlo Ersek Message-ID: <872780e8-46c5-b4ae-520b-742159673abe@redhat.com> Date: Fri, 25 Nov 2016 12:09:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161125060312.27932-5-jeff.fan@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 25 Nov 2016 11:09:39 +0000 (UTC) Subject: Re: [PATCH v2 4/5] UefiCpuPkg/DxeMpLib: Fix bug when getting target C-State from eax X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 11:09:40 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 11/25/16 07:03, Jeff Fan wrote: > AP will get target C-State from eax[7:4]. We do shift in ebx firstly before set > to eax. It will lead ebx is correct in the next time. Please replace the word "correct" with "incorrect" in the commit message -- without the patch, ebx is wrong at the second and further iterations. With that word changed: Reviewed-by: Laszlo Ersek Thanks! Laszlo > > The fix is to set ebx to eax firstly and does shift in eax. Thus, ebx could keep > original value. > > Reported-by: Laszlo Ersek > Cc: Laszlo Ersek > Cc: Feng Tian > Cc: Michael D Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jeff Fan > --- > UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > index f8f4712..34c07a6 100644 > --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm > @@ -266,8 +266,8 @@ MwaitLoop: > xor ecx, ecx ; ecx = 0 > xor edx, edx ; edx = 0 > monitor > - shl ebx, 4 > mov eax, ebx ; Mwait Cx, Target C-State per eax[7:4] > + shl eax, 4 > mwait > jmp MwaitLoop > HltLoop: >