1 ;------------------------------------------------------------------------------
3 ; First code executed by processor after resetting.
4 ; Derived from UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm
6 ; Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
7 ; SPDX-License-Identifier: BSD-2-Clause-Patent
9 ;------------------------------------------------------------------------------
16 ; Pad the image size to 4k when page tables are in VTF0
18 ; If the VTF0 image has page tables built in, then we need to make
19 ; sure the end of VTF0 is 4k above where the page tables end.
21 ; This is required so the page tables will be 4k aligned when VTF0 is
22 ; located just below 0x100000000 (4GB) in the firmware device.
24 %ifdef ALIGN_TOP_TO_4K_FOR_PAGING
25 TIMES (0x1000 - ($ - EndOfPageTables) - 0x20) DB 0
29 ; Padding to ensure first guid starts at 0xffffffd0
31 TIMES (15 - ((guidedStructureEnd - guidedStructureStart + 15) % 16)) DB 0
33 ; GUIDed structure. To traverse this you should first verify the
34 ; presence of the table footer guid
35 ; (96b582de-1fb2-45f7-baea-a366c55a082d) at 0xffffffd0. If that
36 ; is found, the two bytes at 0xffffffce are the entire table length.
38 ; The table is composed of structures with the form:
40 ; Data (arbitrary bytes identified by guid)
41 ; length from start of data to end of guid (2 bytes)
44 ; so work back from the footer using the length to traverse until you
45 ; either find the guid you're looking for or run off the beginning of
51 ; SEV-ES Processor Reset support
54 ; For the initial boot of an AP under SEV-ES, the "reset" RIP must be
55 ; programmed to the RAM area defined by SEV_ES_AP_RESET_IP. The data
59 ; CS segment base [31:16]
61 ; GUID (SEV-ES reset block): 00f771de-1a7e-4fcb-890e-68c77e2fb44e
63 ; A hypervisor reads the CS segement base and IP value. The CS segment base
64 ; value represents the high order 16-bits of the CS segment base, so the
65 ; hypervisor must left shift the value of the CS segement base by 16 bits to
66 ; form the full CS segment base for the CS segment register. It would then
67 ; program the EIP register with the IP value as read.
72 DW sevEsResetBlockEnd - sevEsResetBlockStart
73 DB 0xDE, 0x71, 0xF7, 0x00, 0x7E, 0x1A, 0xCB, 0x4F
74 DB 0x89, 0x0E, 0x68, 0xC7, 0x7E, 0x2F, 0xB4, 0x4E
80 ; length of whole table (16 bit word)
81 ; GUID (table footer): 96b582de-1fb2-45f7-baea-a366c55a082d
83 DW guidedStructureEnd - guidedStructureStart
84 DB 0xDE, 0x82, 0xB5, 0x96, 0xB2, 0x1F, 0xF7, 0x45
85 DB 0xBA, 0xEA, 0xA3, 0x66, 0xC5, 0x5A, 0x08, 0x2D
91 applicationProcessorEntryPoint:
93 ; Application Processors entry point
95 ; GenFv generates code aligned on a 4k boundary which will jump to this
96 ; location. (0xffffffe0) This allows the Local APIC Startup IPI to be
97 ; used to wake up the application processors.
108 ; VTF-0 means that the VTF (Volume Top File) code does not require
120 ; This is where the processor will begin execution
124 jmp EarlyBspInitReal16