26#define GET_GPAW_INIT_STATE(INFO) ((UINT8) ((INFO) & 0x3f))
36 { EfiMaxMemoryType, 0x000 }
47 DEBUG ((DEBUG_INFO,
"InitializePlatform in Pei-less boot\n"));
50 PlatformInfoHob->DefaultMaxCpuNumber = 64;
51 PlatformInfoHob->PcdPciMmio64Size = 0x800000000;
53 PlatformInfoHob->HostBridgeDevId =
PciRead16 (OVMF_HOSTBRIDGE_DID);
54 DEBUG ((DEBUG_INFO,
"HostBridgeDeviceId = 0x%x\n", PlatformInfoHob->HostBridgeDevId));
59 "PhysMemAddressWidth=0x%x, Pci64Base=0x%llx, Pci64Size=0x%llx\n",
60 PlatformInfoHob->PhysMemAddressWidth,
61 PlatformInfoHob->PcdPciMmio64Base,
62 PlatformInfoHob->PcdPciMmio64Size
68 "MaxCpuCount=%d, BootCpuCount=%d\n",
69 PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber,
70 PlatformInfoHob->PcdCpuBootLogicalProcessorNumber
73 PlatformGetSystemMemorySizeBelow4gb (PlatformInfoHob);
74 PlatformQemuUc32BaseInitialization (PlatformInfoHob);
77 "Uc32Base = 0x%x, Uc32Size = 0x%x, LowerMemorySize = 0x%x\n",
78 PlatformInfoHob->Uc32Base,
79 PlatformInfoHob->Uc32Size,
80 PlatformInfoHob->LowMemory
84 PlatformInfoHob->PcdEmuVariableNvStoreReserved = (UINT64)(
UINTN)VariableStore;
93 PlatformQemuInitializeRamForS3 (PlatformInfoHob);
100 &gEfiMemoryTypeInformationGuid,
101 mDefaultMemoryTypeInformation,
102 sizeof (mDefaultMemoryTypeInformation)
105 PlatformMemMapInitialization (PlatformInfoHob);
110 PlatformInfoHob->PcdConfidentialComputingGuestAttr = CCAttrIntelTdx;
114 PlatformMiscInitialization (PlatformInfoHob);
148 ZeroMem (&PlatformInfoHob,
sizeof (PlatformInfoHob));
152 Status =
TdCall (TDCALL_TDINFO, 0, 0, 0, &TdReturnData);
157 "Tdx started with(Hob: 0x%x, Gpaw: 0x%x, Cpus: %d)\n",
158 (UINT32)(
UINTN)VmmHobList,
159 GET_GPAW_INIT_STATE (TdReturnData.TdInfo.Gpaw),
160 TdReturnData.TdInfo.NumVcpus
165 DEBUG ((DEBUG_INFO,
"Ovmf started\n"));
169 if (EFI_ERROR (Status)) {
181 if (EFI_ERROR (Status)) {
191 if (EFI_ERROR (Status)) {
207 DxeCodeBase =
PcdGet32 (PcdBfvBase);
211 DEBUG ((DEBUG_INFO,
"SecFv : %p, 0x%x\n", BootFv, BootFv->
FvLength));
212 DEBUG ((DEBUG_INFO,
"DxeFv : %x, 0x%x\n", DxeCodeBase, DxeCodeSize));
217 EFI_RESOURCE_SYSTEM_MEMORY,
218 EFI_RESOURCE_ATTRIBUTE_PRESENT |
219 EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
220 EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
221 EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
222 EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
223 EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
224 EFI_RESOURCE_ATTRIBUTE_TESTED,
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
VOID EFIAPI BuildResourceDescriptorHob(IN EFI_RESOURCE_TYPE ResourceType, IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, IN EFI_PHYSICAL_ADDRESS PhysicalStart, IN UINT64 NumberOfBytes)
VOID EFIAPI BuildFvHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
VOID *EFIAPI GetHobList(VOID)
VOID EFIAPI BuildStackHob(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length)
UINTN EFIAPI TdCall(IN UINT64 Leaf, IN UINT64 Arg1, IN UINT64 Arg2, IN UINT64 Arg3, IN OUT VOID *Results)
VOID EFIAPI CpuDeadLoop(VOID)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI DxeLoadCore(IN CONST EFI_DXE_IPL_PPI *This, IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_HOB_POINTERS HobList)
#define DEBUG(Expression)
UINT16 EFIAPI PciRead16(IN UINTN Address)
BOOLEAN EFIAPI TdIsEnabled()
EFI_STATUS EFIAPI ConstructSecHobList()
EFI_STATUS EFIAPI ConstructFwHobList(IN CONST VOID *VmmHobList)
#define FixedPcdGet32(TokenName)
#define PcdGet32(TokenName)
#define FeaturePcdGet(TokenName)
VOID EFIAPI PeilessStartup(IN VOID *Context)
EFI_STATUS EFIAPI TdxHelperBuildGuidHobForTdxMeasurement(VOID)
UINT64 EFIAPI TdSharedPageMask(VOID)
VOID * BootFirmwareVolumeBase