]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: increase NumApsExecuting only for ApInitConfig
authorRay Ni <ray.ni@intel.com>
Tue, 4 Jun 2019 10:49:25 +0000 (18:49 +0800)
committerRay Ni <ray.ni@intel.com>
Mon, 10 Jun 2019 02:53:42 +0000 (10:53 +0800)
NumApsExecuting is only used when InitFlag == ApInitConfig for
counting the processor count.

The patch changes Ia32 version of waking up vector assembly code
to align to x64 version of waking up vector assembly code.
After the change both versions of waking up vector increase
NumApsExecuting when InitFlag == ApInitConfig.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm

index 34b8705adb5145a0313dc168353b8ca23cf6fb92..b74046b76af32fc8a0a6e8518a9255cac7d832b5 100644 (file)
@@ -1,5 +1,5 @@
 ;------------------------------------------------------------------------------ ;\r
 ;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
 ; SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ; Module Name:\r
 ; SPDX-License-Identifier: BSD-2-Clause-Patent\r
 ;\r
 ; Module Name:\r
@@ -81,12 +81,6 @@ Flat32Start:                                   ; protected mode entry point
 \r
     mov        esi, ebx\r
 \r
 \r
     mov        esi, ebx\r
 \r
-    ; Increment the number of APs executing here as early as possible\r
-    ; This is decremented in C code when AP is finished executing\r
-    mov        edi, esi\r
-    add        edi, NumApsExecutingLocation\r
-    lock inc   dword [edi]\r
-\r
     mov         edi, esi\r
     add         edi, EnableExecuteDisableLocation\r
     cmp         byte [edi], 0\r
     mov         edi, esi\r
     add         edi, EnableExecuteDisableLocation\r
     cmp         byte [edi], 0\r
@@ -120,6 +114,12 @@ SkipEnableExecuteDisable:
     cmp        dword [edi], 1       ; 1 == ApInitConfig\r
     jnz        GetApicId\r
 \r
     cmp        dword [edi], 1       ; 1 == ApInitConfig\r
     jnz        GetApicId\r
 \r
+    ; Increment the number of APs executing here as early as possible\r
+    ; This is decremented in C code when AP is finished executing\r
+    mov        edi, esi\r
+    add        edi, NumApsExecutingLocation\r
+    lock inc   dword [edi]\r
+\r
     ; AP init\r
     mov        edi, esi\r
     add        edi, LockLocation\r
     ; AP init\r
     mov        edi, esi\r
     add        edi, LockLocation\r