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 ; SEV-ES Processor Reset support
32 ; For the initial boot of an AP under SEV-ES, the "reset" RIP must be
33 ; programmed to the RAM area defined by SEV_ES_AP_RESET_IP. A known offset
34 ; and GUID will be used to locate this block in the firmware and extract
35 ; the build time RIP value. The GUID must always be 48 bytes from the
36 ; end of the firmware.
38 ; 0xffffffca (-0x36) - IP value
39 ; 0xffffffcc (-0x34) - CS segment base [31:16]
40 ; 0xffffffce (-0x32) - Size of the SEV-ES reset block
41 ; 0xffffffd0 (-0x30) - SEV-ES reset block GUID
42 ; (00f771de-1a7e-4fcb-890e-68c77e2fb44e)
44 ; A hypervisor reads the CS segement base and IP value. The CS segment base
45 ; value represents the high order 16-bits of the CS segment base, so the
46 ; hypervisor must left shift the value of the CS segement base by 16 bits to
47 ; form the full CS segment base for the CS segment register. It would then
48 ; program the EIP register with the IP value as read.
51 TIMES (32 - (sevEsResetBlockEnd - sevEsResetBlockStart)) DB 0
55 DW sevEsResetBlockEnd - sevEsResetBlockStart
56 DB 0xDE, 0x71, 0xF7, 0x00, 0x7E, 0x1A, 0xCB, 0x4F
57 DB 0x89, 0x0E, 0x68, 0xC7, 0x7E, 0x2F, 0xB4, 0x4E
62 applicationProcessorEntryPoint:
64 ; Application Processors entry point
66 ; GenFv generates code aligned on a 4k boundary which will jump to this
67 ; location. (0xffffffe0) This allows the Local APIC Startup IPI to be
68 ; used to wake up the application processors.
79 ; VTF-0 means that the VTF (Volume Top File) code does not require
91 ; This is where the processor will begin execution
95 jmp EarlyBspInitReal16