From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 E192081EE5 for ; Thu, 24 Nov 2016 22:03:23 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 24 Nov 2016 22:03:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,693,1473145200"; d="scan'208";a="1063955926" Received: from jfan12-desk.ccr.corp.intel.com ([10.239.9.5]) by orsmga001.jf.intel.com with ESMTP; 24 Nov 2016 22:03:21 -0800 From: Jeff Fan To: edk2-devel@lists.01.org Cc: Laszlo Ersek , Feng Tian , Michael D Kinney Date: Fri, 25 Nov 2016 14:03:11 +0800 Message-Id: <20161125060312.27932-5-jeff.fan@intel.com> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20161125060312.27932-1-jeff.fan@intel.com> References: <20161125060312.27932-1-jeff.fan@intel.com> Subject: [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 06:03:24 -0000 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. 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: -- 2.9.3.windows.2