1 ;------------------------------------------------------------------------------
3 ; This file includes all other code files to assemble the reset vector code
5 ; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
6 ; Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
7 ; SPDX-License-Identifier: BSD-2-Clause-Patent
9 ;------------------------------------------------------------------------------
12 ; If neither ARCH_IA32 nor ARCH_X64 are defined, then try to include
13 ; Base.h to use the C pre-processor to determine the architecture.
18 #if defined (MDE_CPU_IA32)
20 #elif defined (MDE_CPU_X64)
28 %error "Only one of ARCH_IA32 or ARCH_X64 can be defined."
32 %error "Either ARCH_IA32 or ARCH_X64 must be defined."
35 %include "CommonMacros.inc"
37 %include "PostCodes.inc"
40 %include "Port80Debug.asm"
42 %include "SerialDebug.asm"
44 %include "DebugDisabled.asm"
47 %include "Ia32/SearchForBfvBase.asm"
48 %include "Ia32/SearchForSecEntry.asm"
53 %if (FixedPcdGet32 (PcdOvmfSecPageTablesSize) != 0x6000)
54 %error "This implementation inherently depends on PcdOvmfSecPageTablesSize"
57 %if (FixedPcdGet32 (PcdOvmfSecGhcbPageTableSize) != 0x1000)
58 %error "This implementation inherently depends on PcdOvmfSecGhcbPageTableSize"
61 %if (FixedPcdGet32 (PcdOvmfSecGhcbSize) != 0x2000)
62 %error "This implementation inherently depends on PcdOvmfSecGhcbSize"
65 %if ((FixedPcdGet32 (PcdOvmfSecGhcbBase) >> 21) != \
66 ((FixedPcdGet32 (PcdOvmfSecGhcbBase) + FixedPcdGet32 (PcdOvmfSecGhcbSize) - 1) >> 21))
67 %error "This implementation inherently depends on PcdOvmfSecGhcbBase not straddling a 2MB boundary"
70 %define PT_ADDR(Offset) (FixedPcdGet32 (PcdOvmfSecPageTablesBase) + (Offset))
72 %define GHCB_PT_ADDR (FixedPcdGet32 (PcdOvmfSecGhcbPageTableBase))
73 %define GHCB_BASE (FixedPcdGet32 (PcdOvmfSecGhcbBase))
74 %define GHCB_SIZE (FixedPcdGet32 (PcdOvmfSecGhcbSize))
75 %define SEV_ES_WORK_AREA (FixedPcdGet32 (PcdSevEsWorkAreaBase))
76 %define SEV_ES_WORK_AREA_RDRAND (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 8)
77 %define SEV_ES_WORK_AREA_ENC_MASK (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 16)
78 %define SEV_ES_VC_TOP_OF_STACK (FixedPcdGet32 (PcdOvmfSecPeiTempRamBase) + FixedPcdGet32 (PcdOvmfSecPeiTempRamSize))
79 %include "Ia32/Flat32ToFlat64.asm"
80 %include "Ia32/AmdSev.asm"
81 %include "Ia32/PageTables64.asm"
84 %include "Ia16/Real16ToFlat32.asm"
85 %include "Ia16/Init16.asm"
89 %define SEV_ES_AP_RESET_IP FixedPcdGet32 (PcdSevEsWorkAreaBase)
90 %define SEV_LAUNCH_SECRET_BASE FixedPcdGet32 (PcdSevLaunchSecretBase)
91 %define SEV_LAUNCH_SECRET_SIZE FixedPcdGet32 (PcdSevLaunchSecretSize)
92 %define SEV_FW_HASH_BLOCK_BASE FixedPcdGet32 (PcdQemuHashTableBase)
93 %define SEV_FW_HASH_BLOCK_SIZE FixedPcdGet32 (PcdQemuHashTableSize)
94 %include "Ia16/ResetVectorVtf0.asm"