summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-25 12:58:36 +0800
committerJeff Fan <jeff.fan@intel.com>2016-11-28 08:56:48 +0800
commitf56379f3610e51a01a18c00e4a0d5fded3af0657 (patch)
treeaf1f0b74387eee3dd9ce94f3bb6e1e8f3e31ba1a
parent9f91cb01c43e394f5368c6e9d16b58cbebf9ad9b (diff)
downloadedk2-platforms-f56379f3610e51a01a18c00e4a0d5fded3af0657.tar.xz
UefiCpuPkg/DxeMpLib: Fix bug when getting target C-State from eax
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 incorrect 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 <lersek@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm2
1 files changed, 1 insertions, 1 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm
index f8f471233e..34c07a6d51 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: