UefiCpuPkg/DxeMpLib: Fix bug when getting target C-State from eax
authorJeff Fan <jeff.fan@intel.com>
Fri, 25 Nov 2016 04:58:36 +0000 (12:58 +0800)
committerJeff Fan <jeff.fan@intel.com>
Mon, 28 Nov 2016 00:56:48 +0000 (08:56 +0800)
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>

index f8f471233e15d0fe87edf9795cb150344d629ab7..34c07a6d51d2835b80fe00dc7facf775adfca82f 100644 (file)
@@ -266,8 +266,8 @@ MwaitLoop:
     xor        ecx, ecx           ; ecx = 0\r
     xor        edx, edx           ; edx = 0\r
-    shl        ebx, 4\r
     mov        eax, ebx           ; Mwait Cx, Target C-State per eax[7:4]\r
+    shl        eax, 4\r
     jmp        MwaitLoop\r