]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/SecCore: Add pre-memory AP vector
authorCole, Deric <deric.cole@intel.com>
Mon, 1 Jun 2020 22:32:25 +0000 (06:32 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 23 Jun 2020 01:50:29 +0000 (01:50 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2776

Add a vector at 0xFF000 (0xFFFFF000) that can be used by Init-SIPI-SIPI
to start an AP before memory is initialized. This vector jumps into the
same SEC entry point as the ordinary reset vector, with a special value
of "AP" in the DI register. The platform-specific SEC code is expected
to check for that value and take a different path for APs, if this
feature is supported by the platform.

Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Deric Cole <deric.cole@intel.com>
UefiCpuPkg/SecCore/Ia32/ResetVec.nasmb

index f41b9669d0c25ad47b0c365643f5ea81886c62dc..1dfc4efe4c815c777d9ae704c25062f0f1387fba 100644 (file)
@@ -10,7 +10,7 @@
 ; Abstract:\r
 ;\r
 ;  Reset Vector Data structure\r
-;  This structure is located at 0xFFFFFFC0\r
+;  This structure is located at 0xFFFFF000\r
 ;\r
 ;------------------------------------------------------------------------------\r
 \r
@@ -23,19 +23,36 @@ USE16
 ;\r
 \r
     ORG     0h\r
+\r
+;\r
+; 0xFFFFF000\r
+;\r
+; We enter here with CS:IP = 0xFF00:0x0000. Do a far-jump to change CS to 0xF000\r
+; and IP to ApStartup.\r
+;\r
+ApVector:\r
+    mov     di, "AP"\r
+    jmp     0xF000:0xF000+ApStartup\r
+\r
+    TIMES 0xFC0-($-$$) nop\r
+\r
+;\r
+; This should be at 0xFFFFFFC0\r
+;\r
+\r
 ;\r
 ; Reserved\r
 ;\r
 ReservedData:            DD 0eeeeeeeeh, 0eeeeeeeeh\r
 \r
-    TIMES 0x10-($-$$) DB 0\r
+    TIMES 0xFD0-($-$$) nop\r
 ;\r
-; This is located at 0xFFFFFFD0h\r
+; This is located at 0xFFFFFFD0\r
 ;\r
     mov     di, "PA"\r
     jmp     ApStartup\r
 \r
-    TIMES 0x20-($-$$) DB 0\r
+    TIMES 0xFE0-($-$$) nop\r
 ;\r
 ; Pointer to the entry point of the PEI core\r
 ; It is located at 0xFFFFFFE0, and is fixed up by some build tool\r
@@ -53,7 +70,7 @@ ASM_PFX(InterruptHandler):
     jmp     $\r
     iret\r
 \r
-    TIMES 0x30-($-$$) DB 0\r
+    TIMES 0xFF0-($-$$) nop\r
 ;\r
 ; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte\r
 ; Execution starts here upon power-on/platform-reset.\r
@@ -74,7 +91,7 @@ ApStartup:
     DW      -3\r
 \r
 \r
-    TIMES 0x38-($-$$) DB 0\r
+    TIMES 0xFF8-($-$$) nop\r
 ;\r
 ; Ap reset vector segment address is at 0xFFFFFFF8\r
 ; This will be fixed up by some build tool,\r
@@ -83,7 +100,7 @@ ApStartup:
 ;\r
 ApSegAddress:    dd      12345678h\r
 \r
-    TIMES 0x3c-($-$$) DB 0\r
+    TIMES 0xFFC-($-$$) nop\r
 ;\r
 ; BFV Base is at 0xFFFFFFFC\r
 ; This will be fixed up by some build tool,\r