Changeset 89983 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library
- Timestamp:
- Jul 1, 2021 8:17:41 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145450
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 7 added
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-139864 /vendor/edk2/current 103735-103757,103769-103776,129194-145445
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c
r80721 r89983 3 3 on ARM platforms. 4 4 5 Copyright (c) 2017 - 20 18, ARMLtd. All rights reserved.<BR>5 Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 47 47 suitable for consumption by the MM Core and drivers. 48 48 49 @param PayloadBootInfo Boot information passed by privileged firmware 49 @param [in, out] CpuDriverEntryPoint Address of MM CPU driver entrypoint 50 @param [in] PayloadBootInfo Boot information passed by privileged 51 firmware 50 52 51 53 **/ -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c
r80721 r89983 3 3 Foundation Entry point on ARM platforms. 4 4 5 Copyright (c) 2017 - 20 18, ARMLtd. All rights reserved.<BR>5 Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 26 26 #include <IndustryStandard/ArmStdSmc.h> 27 27 28 /** 29 Privileged firmware assigns RO & Executable attributes to all memory occupied 30 by the Boot Firmware Volume. This function sets the correct permissions of 31 sections in the Standalone MM Core module to be able to access RO and RW data 32 and make further progress in the boot process. 33 34 @param [in] ImageContext Pointer to PE/COFF image context 35 @param [in] ImageBase Base of image in memory 36 @param [in] SectionHeaderOffset Offset of PE/COFF image section header 37 @param [in] NumberOfSections Number of Sections 38 @param [in] TextUpdater Function to change code permissions 39 @param [in] ReadOnlyUpdater Function to change RO permissions 40 @param [in] ReadWriteUpdater Function to change RW permissions 41 42 **/ 28 43 EFI_STATUS 29 44 EFIAPI 30 45 UpdateMmFoundationPeCoffPermissions ( 31 46 IN CONST PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, 47 IN EFI_PHYSICAL_ADDRESS ImageBase, 32 48 IN UINT32 SectionHeaderOffset, 33 49 IN CONST UINT16 NumberOfSections, … … 88 104 // 89 105 if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_EXECUTE) == 0) { 90 Base = Image Context->ImageAddress+ SectionHeader.VirtualAddress;106 Base = ImageBase + SectionHeader.VirtualAddress; 91 107 92 108 TextUpdater (Base, SectionHeader.Misc.VirtualSize); … … 113 129 } 114 130 131 /** 132 Privileged firmware assigns RO & Executable attributes to all memory occupied 133 by the Boot Firmware Volume. This function locates the Standalone MM Core 134 module PE/COFF image in the BFV and returns this information. 135 136 @param [in] BfvAddress Base Address of Boot Firmware Volume 137 @param [in, out] TeData Pointer to address for allocating memory 138 for PE/COFF image data 139 @param [in, out] TeDataSize Pointer to size of PE/COFF image data 140 141 **/ 115 142 EFI_STATUS 116 143 EFIAPI … … 121 148 ) 122 149 { 123 EFI_FFS_FILE_HEADER *FileHeader = NULL;150 EFI_FFS_FILE_HEADER *FileHeader; 124 151 EFI_STATUS Status; 125 152 153 FileHeader = NULL; 126 154 Status = FfsFindNextFile ( 127 155 EFI_FV_FILETYPE_SECURITY_CORE, … … 150 178 } 151 179 180 /** 181 Returns the PC COFF section information. 182 183 @param [in, out] ImageContext Pointer to PE/COFF image context 184 @param [out] ImageBase Base of image in memory 185 @param [out] SectionHeaderOffset Offset of PE/COFF image section header 186 @param [out] NumberOfSections Number of Sections 187 188 **/ 152 189 STATIC 153 190 EFI_STATUS 154 191 GetPeCoffSectionInformation ( 155 192 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, 193 OUT EFI_PHYSICAL_ADDRESS *ImageBase, 156 194 OUT UINT32 *SectionHeaderOffset, 157 195 OUT UINT16 *NumberOfSections … … 213 251 } 214 252 253 *ImageBase = ImageContext->ImageAddress; 215 254 if (!ImageContext->IsTeImage) { 216 255 ASSERT (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE); … … 233 272 *SectionHeaderOffset = (UINTN)(sizeof (EFI_TE_IMAGE_HEADER)); 234 273 *NumberOfSections = Hdr.Te->NumberOfSections; 235 ImageContext->ImageAddress-= (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER);274 *ImageBase -= (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER); 236 275 } 237 276 return RETURN_SUCCESS; 238 277 } 239 278 279 /** 280 Privileged firmware assigns RO & Executable attributes to all memory occupied 281 by the Boot Firmware Volume. This function locates the section information of 282 the Standalone MM Core module to be able to change permissions of the 283 individual sections later in the boot process. 284 285 @param [in] TeData Pointer to PE/COFF image data 286 @param [in, out] ImageContext Pointer to PE/COFF image context 287 @param [out] ImageBase Pointer to ImageBase variable 288 @param [in, out] SectionHeaderOffset Offset of PE/COFF image section header 289 @param [in, out] NumberOfSections Number of Sections 290 291 **/ 240 292 EFI_STATUS 241 293 EFIAPI … … 243 295 IN VOID *TeData, 244 296 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, 297 OUT EFI_PHYSICAL_ADDRESS *ImageBase, 245 298 IN OUT UINT32 *SectionHeaderOffset, 246 299 IN OUT UINT16 *NumberOfSections … … 256 309 DEBUG ((DEBUG_INFO, "Found Standalone MM PE data - 0x%x\n", TeData)); 257 310 258 Status = GetPeCoffSectionInformation (ImageContext, SectionHeaderOffset, NumberOfSections); 311 Status = GetPeCoffSectionInformation (ImageContext, ImageBase, 312 SectionHeaderOffset, NumberOfSections); 259 313 if (EFI_ERROR (Status)) { 260 314 DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Core PE-COFF Section information - %r\n", Status)); -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c
r80721 r89983 3 3 phase on ARM platforms 4 4 5 Copyright (c) 2017 - 20 18, ARMLtd. All rights reserved.<BR>5 Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.<BR> 6 6 SPDX-License-Identifier: BSD-2-Clause-Patent 7 7 … … 24 24 #include <Library/BaseMemoryLib.h> 25 25 #include <Library/SerialPortLib.h> 26 #include <Library/PcdLib.h> 26 27 27 28 #include <IndustryStandard/ArmStdSmc.h> 28 29 #include <IndustryStandard/ArmMmSvc.h> 30 #include <IndustryStandard/ArmFfaSvc.h> 29 31 30 32 #define SPM_MAJOR_VER_MASK 0xFFFF0000 31 33 #define SPM_MINOR_VER_MASK 0x0000FFFF 32 34 #define SPM_MAJOR_VER_SHIFT 16 33 34 CONST UINT32 SPM_MAJOR_VER = 0; 35 CONST UINT32 SPM_MINOR_VER = 1; 36 37 CONST UINT8 BOOT_PAYLOAD_VERSION = 1; 35 #define FFA_NOT_SUPPORTED -1 36 37 STATIC CONST UINT32 mSpmMajorVer = SPM_MAJOR_VERSION; 38 STATIC CONST UINT32 mSpmMinorVer = SPM_MINOR_VERSION; 39 40 STATIC CONST UINT32 mSpmMajorVerFfa = SPM_MAJOR_VERSION_FFA; 41 STATIC CONST UINT32 mSpmMinorVerFfa = SPM_MINOR_VERSION_FFA; 42 43 #define BOOT_PAYLOAD_VERSION 1 38 44 39 45 PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint = NULL; … … 41 47 /** 42 48 Retrieve a pointer to and print the boot information passed by privileged 43 secure firmware 44 45 @param SharedBufAddress The pointer memory shared with privileged firmware 49 secure firmware. 50 51 @param [in] SharedBufAddress The pointer memory shared with privileged 52 firmware. 46 53 47 54 **/ … … 102 109 } 103 110 111 /** 112 A loop to delegated events. 113 114 @param [in] EventCompleteSvcArgs Pointer to the event completion arguments. 115 116 **/ 104 117 VOID 105 118 EFIAPI … … 108 121 ) 109 122 { 123 BOOLEAN FfaEnabled; 110 124 EFI_STATUS Status; 111 125 UINTN SvcStatus; … … 119 133 DEBUG ((DEBUG_INFO, "X2 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg2)); 120 134 DEBUG ((DEBUG_INFO, "X3 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg3)); 121 122 Status = CpuDriverEntryPoint ( 123 EventCompleteSvcArgs->Arg0, 124 EventCompleteSvcArgs->Arg3, 125 EventCompleteSvcArgs->Arg1 126 ); 127 128 if (EFI_ERROR (Status)) { 129 DEBUG ((DEBUG_ERROR, "Failed delegated event 0x%x, Status 0x%x\n", 130 EventCompleteSvcArgs->Arg0, Status)); 135 DEBUG ((DEBUG_INFO, "X4 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg4)); 136 DEBUG ((DEBUG_INFO, "X5 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg5)); 137 DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg6)); 138 DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32) EventCompleteSvcArgs->Arg7)); 139 140 FfaEnabled = FeaturePcdGet (PcdFfaEnable); 141 if (FfaEnabled) { 142 Status = CpuDriverEntryPoint ( 143 EventCompleteSvcArgs->Arg0, 144 EventCompleteSvcArgs->Arg6, 145 EventCompleteSvcArgs->Arg3 146 ); 147 if (EFI_ERROR (Status)) { 148 DEBUG ((DEBUG_ERROR, "Failed delegated event 0x%x, Status 0x%x\n", 149 EventCompleteSvcArgs->Arg3, Status)); 150 } 151 } else { 152 Status = CpuDriverEntryPoint ( 153 EventCompleteSvcArgs->Arg0, 154 EventCompleteSvcArgs->Arg3, 155 EventCompleteSvcArgs->Arg1 156 ); 157 if (EFI_ERROR (Status)) { 158 DEBUG ((DEBUG_ERROR, "Failed delegated event 0x%x, Status 0x%x\n", 159 EventCompleteSvcArgs->Arg0, Status)); 160 } 131 161 } 132 162 … … 152 182 } 153 183 154 EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 155 EventCompleteSvcArgs->Arg1 = SvcStatus; 184 if (FfaEnabled) { 185 EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64; 186 EventCompleteSvcArgs->Arg1 = 0; 187 EventCompleteSvcArgs->Arg2 = 0; 188 EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 189 EventCompleteSvcArgs->Arg4 = SvcStatus; 190 } else { 191 EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 192 EventCompleteSvcArgs->Arg1 = SvcStatus; 193 } 156 194 } 157 195 } 158 196 197 /** 198 Query the SPM version, check compatibility and return success if compatible. 199 200 @retval EFI_SUCCESS SPM versions compatible. 201 @retval EFI_UNSUPPORTED SPM versions not compatible. 202 **/ 159 203 STATIC 160 204 EFI_STATUS … … 162 206 { 163 207 EFI_STATUS Status; 164 UINT16 SpmMajorVersion; 165 UINT16 SpmMinorVersion; 208 UINT16 CalleeSpmMajorVer; 209 UINT16 CallerSpmMajorVer; 210 UINT16 CalleeSpmMinorVer; 211 UINT16 CallerSpmMinorVer; 166 212 UINT32 SpmVersion; 167 213 ARM_SVC_ARGS SpmVersionArgs; 168 214 169 SpmVersionArgs.Arg0 = ARM_SVC_ID_SPM_VERSION_AARCH32; 215 if (FeaturePcdGet (PcdFfaEnable)) { 216 SpmVersionArgs.Arg0 = ARM_SVC_ID_FFA_VERSION_AARCH32; 217 SpmVersionArgs.Arg1 = mSpmMajorVerFfa << SPM_MAJOR_VER_SHIFT; 218 SpmVersionArgs.Arg1 |= mSpmMinorVerFfa; 219 CallerSpmMajorVer = mSpmMajorVerFfa; 220 CallerSpmMinorVer = mSpmMinorVerFfa; 221 } else { 222 SpmVersionArgs.Arg0 = ARM_SVC_ID_SPM_VERSION_AARCH32; 223 CallerSpmMajorVer = mSpmMajorVer; 224 CallerSpmMinorVer = mSpmMinorVer; 225 } 170 226 171 227 ArmCallSvc (&SpmVersionArgs); 172 228 173 229 SpmVersion = SpmVersionArgs.Arg0; 174 175 SpmMajorVersion = ((SpmVersion & SPM_MAJOR_VER_MASK) >> SPM_MAJOR_VER_SHIFT); 176 SpmMinorVersion = ((SpmVersion & SPM_MINOR_VER_MASK) >> 0); 230 if (SpmVersion == FFA_NOT_SUPPORTED) { 231 return EFI_UNSUPPORTED; 232 } 233 234 CalleeSpmMajorVer = ((SpmVersion & SPM_MAJOR_VER_MASK) >> SPM_MAJOR_VER_SHIFT); 235 CalleeSpmMinorVer = ((SpmVersion & SPM_MINOR_VER_MASK) >> 0); 177 236 178 237 // Different major revision values indicate possibly incompatible functions. … … 183 242 // However, it is possible for revision B to have a higher 184 243 // function count than revision A. 185 if (( SpmMajorVersion == SPM_MAJOR_VER) &&186 ( SpmMinorVersion >= SPM_MINOR_VER))244 if ((CalleeSpmMajorVer == CallerSpmMajorVer) && 245 (CalleeSpmMinorVer >= CallerSpmMinorVer)) 187 246 { 188 247 DEBUG ((DEBUG_INFO, "SPM Version: Major=0x%x, Minor=0x%x\n", 189 SpmMajorVersion, SpmMinorVersion));248 CalleeSpmMajorVer, CalleeSpmMinorVer)); 190 249 Status = EFI_SUCCESS; 191 250 } 192 251 else 193 252 { 194 DEBUG ((DEBUG_INFO, "Incompatible SPM Versions.\n C urrent Version: Major=0x%x, Minor=0x%x.\n Expected: Major=0x%x, Minor>=0x%x.\n",195 SpmMajorVersion, SpmMinorVersion, SPM_MAJOR_VER, SPM_MINOR_VER));253 DEBUG ((DEBUG_INFO, "Incompatible SPM Versions.\n Callee Version: Major=0x%x, Minor=0x%x.\n Caller: Major=0x%x, Minor>=0x%x.\n", 254 CalleeSpmMajorVer, CalleeSpmMinorVer, CallerSpmMajorVer, CallerSpmMinorVer)); 196 255 Status = EFI_UNSUPPORTED; 197 256 } … … 201 260 202 261 /** 262 Initialize parameters to be sent via SVC call. 263 264 @param[out] InitMmFoundationSvcArgs Args structure 265 @param[out] Ret Return Code 266 267 **/ 268 STATIC 269 VOID 270 InitArmSvcArgs ( 271 OUT ARM_SVC_ARGS *InitMmFoundationSvcArgs, 272 OUT INT32 *Ret 273 ) 274 { 275 if (FeaturePcdGet (PcdFfaEnable)) { 276 InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64; 277 InitMmFoundationSvcArgs->Arg1 = 0; 278 InitMmFoundationSvcArgs->Arg2 = 0; 279 InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 280 InitMmFoundationSvcArgs->Arg4 = *Ret; 281 } else { 282 InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 283 InitMmFoundationSvcArgs->Arg1 = *Ret; 284 } 285 } 286 287 /** 203 288 The entry point of Standalone MM Foundation. 204 289 205 @param SharedBufAddress Pointer to the Buffer between SPM and SP. 206 @param cookie1. 207 @param cookie2. 290 @param [in] SharedBufAddress Pointer to the Buffer between SPM and SP. 291 @param [in] SharedBufSize Size of the shared buffer. 292 @param [in] cookie1 Cookie 1 293 @param [in] cookie2 Cookie 2 208 294 209 295 **/ … … 221 307 ARM_SVC_ARGS InitMmFoundationSvcArgs; 222 308 EFI_STATUS Status; 309 INT32 Ret; 223 310 UINT32 SectionHeaderOffset; 224 311 UINT16 NumberOfSections; … … 226 313 VOID *TeData; 227 314 UINTN TeDataSize; 315 EFI_PHYSICAL_ADDRESS ImageBase; 228 316 229 317 // Get Secure Partition Manager Version Information … … 254 342 TeData, 255 343 &ImageContext, 344 &ImageBase, 256 345 &SectionHeaderOffset, 257 346 &NumberOfSections … … 261 350 goto finish; 262 351 } 352 353 // 354 // ImageBase may deviate from ImageContext.ImageAddress if we are dealing 355 // with a TE image, in which case the latter points to the actual offset 356 // of the image, whereas ImageBase refers to the address where the image 357 // would start if the stripped PE headers were still in place. In either 358 // case, we need to fix up ImageBase so it refers to the actual current 359 // load address. 360 // 361 ImageBase += (UINTN)TeData - ImageContext.ImageAddress; 263 362 264 363 // Update the memory access permissions of individual sections in the … … 266 365 Status = UpdateMmFoundationPeCoffPermissions ( 267 366 &ImageContext, 367 ImageBase, 268 368 SectionHeaderOffset, 269 369 NumberOfSections, … … 277 377 } 278 378 379 if (ImageContext.ImageAddress != (UINTN)TeData) { 380 ImageContext.ImageAddress = (UINTN)TeData; 381 ArmSetMemoryRegionNoExec (ImageBase, SIZE_4KB); 382 ArmClearMemoryRegionReadOnly (ImageBase, SIZE_4KB); 383 384 Status = PeCoffLoaderRelocateImage (&ImageContext); 385 ASSERT_EFI_ERROR (Status); 386 } 387 279 388 // 280 389 // Create Hoblist based upon boot information passed by privileged software … … 290 399 291 400 finish: 401 if (Status == RETURN_UNSUPPORTED) { 402 Ret = -1; 403 } else if (Status == RETURN_INVALID_PARAMETER) { 404 Ret = -2; 405 } else if (Status == EFI_NOT_FOUND) { 406 Ret = -7; 407 } else { 408 Ret = 0; 409 } 292 410 ZeroMem (&InitMmFoundationSvcArgs, sizeof(InitMmFoundationSvcArgs)); 293 InitMmFoundationSvcArgs.Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; 294 InitMmFoundationSvcArgs.Arg1 = Status; 411 InitArmSvcArgs (&InitMmFoundationSvcArgs, &Ret); 295 412 DelegatedEventLoop (&InitMmFoundationSvcArgs); 296 413 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
r80721 r89983 2 2 # Module entry point library for DXE core. 3 3 # 4 # Copyright (c) 2017 - 20 18, ARMLtd. All rights reserved.<BR>4 # Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.<BR> 5 5 # 6 6 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 27 27 AArch64/CreateHobList.c 28 28 29 [Sources.X64] 30 X64/StandaloneMmCoreEntryPoint.c 31 29 32 [Packages] 30 33 MdePkg/MdePkg.dec … … 34 37 [Packages.AARCH64] 35 38 ArmPkg/ArmPkg.dec 36 ArmPlatformPkg/ArmPlatformPkg.dec37 39 38 40 [LibraryClasses] … … 49 51 gEfiStandaloneMmNonSecureBufferGuid 50 52 gEfiArmTfCpuDriverEpDescriptorGuid 53 54 [FeaturePcd.AARCH64] 55 gArmTokenSpaceGuid.PcdFfaEnable 56 57 [BuildOptions] 58 GCC:*_*_*_CC_FLAGS = -fpie -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf
r80721 r89983 23 23 24 24 # 25 # VALID_ARCHITECTURES = AARCH6425 # VALID_ARCHITECTURES = X64 AARCH64 26 26 # 27 [Sources.Common] 28 StandaloneMmCoreHobLib.c 27 [Sources.common] 28 Common.c 29 30 [Sources.X64] 31 X64/StandaloneMmCoreHobLib.c 29 32 30 33 [Sources.AARCH64] 34 AArch64/StandaloneMmCoreHobLib.c 31 35 AArch64/StandaloneMmCoreHobLibInternal.c 32 36 33 37 [Packages] 34 38 MdePkg/MdePkg.dec 39 StandaloneMmPkg/StandaloneMmPkg.dec 35 40 36 41 -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.c
r80721 r89983 3 3 4 4 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> 5 Copyright (c) 2016 - 20 18, ARM Limited. All rights reserved.<BR>5 Copyright (c) 2016 - 2021, ARM Limited. All rights reserved.<BR> 6 6 7 7 SPDX-License-Identifier: BSD-2-Clause-Patent … … 823 823 memory in MMRAM and caches EFI_MM_SYSTEM_TABLE pointer. 824 824 825 @param ImageHandleThe firmware allocated handle for the EFI image.826 @param SystemTable A pointer to the Management mode System Table.825 @param [in] ImageHandle The firmware allocated handle for the EFI image. 826 @param [in] MmSystemTable A pointer to the Management mode System Table. 827 827 828 828 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. … … 842 842 EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHobData; 843 843 EFI_MMRAM_DESCRIPTOR *MmramRanges; 844 UINT 32MmramRangeCount;844 UINTN MmramRangeCount; 845 845 EFI_HOB_GUID_TYPE *MmramRangesHob; 846 846 … … 869 869 } 870 870 871 MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;871 MmramRangeCount = (UINTN) MmramRangesHobData->NumberOfMmReservedRegions; 872 872 if (MmramRanges == NULL) { 873 873 return EFI_UNSUPPORTED; … … 878 878 MmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address; 879 879 MmramRanges = (EFI_MMRAM_DESCRIPTOR *)(UINTN)MmCorePrivate->MmramRanges; 880 MmramRangeCount = MmCorePrivate->MmramRangeCount;880 MmramRangeCount = (UINTN) MmCorePrivate->MmramRangeCount; 881 881 } 882 882 -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
r80721 r89983 2 2 # Memory Allocation Library instance dedicated to MM Core. 3 3 # The implementation borrows the MM Core Memory Allocation services as the primitive 4 # for memory allocation instead of using MM System Table serv ces in an indirect way.4 # for memory allocation instead of using MM System Table services in an indirect way. 5 5 # It is assumed that this library instance must be linked with MM Core in this package. 6 6 # 7 7 # Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR> 8 # Copyright (c) 2016 - 20 18, ARMLimited. All rights reserved.<BR>8 # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR> 9 9 # 10 10 # SPDX-License-Identifier: BSD-2-Clause-Patent -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c
r80721 r89983 41 41 } 42 42 43 /** 44 Initialize cached Mmram Ranges from HOB. 43 45 46 @retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information. 47 @retval EFI_SUCCESS MmRanges are populated successfully. 48 49 **/ 50 EFI_STATUS 51 MmMemLibInternalPopulateMmramRanges ( 52 VOID 53 ) 54 { 55 // Not implemented for AARCH64. 56 return EFI_SUCCESS; 57 } 58 59 /** 60 Deinitialize cached Mmram Ranges. 61 62 **/ 63 VOID 64 MmMemLibInternalFreeMmramRanges ( 65 VOID 66 ) 67 { 68 // Not implemented for AARCH64. 69 } 70 -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.c
r80721 r89983 8 8 9 9 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> 10 Copyright (c) 2016 - 20 18, ARMLimited. All rights reserved.<BR>10 Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR> 11 11 12 12 SPDX-License-Identifier: BSD-2-Clause-Patent … … 35 35 VOID 36 36 MmMemLibInternalCalculateMaximumSupportAddress ( 37 VOID 38 ); 39 40 /** 41 Initialize cached Mmram Ranges from HOB. 42 43 @retval EFI_UNSUPPORTED The routine is unable to extract MMRAM information. 44 @retval EFI_SUCCESS MmRanges are populated successfully. 45 46 **/ 47 EFI_STATUS 48 MmMemLibInternalPopulateMmramRanges ( 49 VOID 50 ); 51 52 /** 53 Deinitialize cached Mmram Ranges. 54 55 **/ 56 VOID 57 MmMemLibInternalFreeMmramRanges ( 37 58 VOID 38 59 ); … … 146 167 @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer. 147 168 148 @retval EFI_SECURITY_VIOLATION The Des inationBuffer is invalid per processor architecture or overlap with MMRAM.169 @retval EFI_SECURITY_VIOLATION The DestinationBuffer is invalid per processor architecture or overlap with MMRAM. 149 170 @retval EFI_SUCCESS Memory is copied. 150 171 … … 180 201 @param Length The number of bytes to copy from SourceBuffer to DestinationBuffer. 181 202 182 @retval EFI_SECURITY_VIOLATION The Des inationBuffer is invalid per processor architecture or overlap with MMRAM.203 @retval EFI_SECURITY_VIOLATION The DestinationBuffer is invalid per processor architecture or overlap with MMRAM. 183 204 @retval EFI_SECURITY_VIOLATION The SourceBuffer is invalid per processor architecture or overlap with MMRAM. 184 205 @retval EFI_SUCCESS Memory is copied. … … 241 262 The constructor function initializes the Mm Mem library 242 263 243 @param ImageHandleThe firmware allocated handle for the EFI image.244 @param SystemTable A pointer to the EFI System Table.264 @param [in] ImageHandle The firmware allocated handle for the EFI image. 265 @param [in] MmSystemTable A pointer to the EFI System Table. 245 266 246 267 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. … … 254 275 ) 255 276 { 277 EFI_STATUS Status; 256 278 257 279 // … … 260 282 MmMemLibInternalCalculateMaximumSupportAddress (); 261 283 262 return EFI_SUCCESS; 263 } 284 // 285 // Initialize cached Mmram Ranges from HOB. 286 // 287 Status = MmMemLibInternalPopulateMmramRanges (); 288 289 return Status; 290 } 291 292 /** 293 Destructor for Mm Mem library. 294 295 @param ImageHandle The image handle of the process. 296 @param MmSystemTable The EFI System Table pointer. 297 298 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. 299 300 **/ 301 EFI_STATUS 302 EFIAPI 303 MemLibDestructor ( 304 IN EFI_HANDLE ImageHandle, 305 IN EFI_MM_SYSTEM_TABLE *MmSystemTable 306 ) 307 { 308 309 // 310 // Deinitialize cached Mmram Ranges. 311 // 312 MmMemLibInternalFreeMmramRanges (); 313 314 return EFI_SUCCESS; 315 } -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
r80721 r89983 9 9 # Copyright (c) 2015, Intel Corporation. All rights reserved.<BR> 10 10 # Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR> 11 # Copyright (c) Microsoft Corporation. 11 12 # 12 13 # SPDX-License-Identifier: BSD-2-Clause-Patent … … 23 24 LIBRARY_CLASS = MemLib|MM_STANDALONE MM_CORE_STANDALONE 24 25 CONSTRUCTOR = MemLibConstructor 26 DESTRUCTOR = MemLibDestructor 25 27 26 28 # 27 29 # The following information is for reference only and not required by the build tools. 28 30 # 29 # VALID_ARCHITECTURES = AARCH6431 # VALID_ARCHITECTURES = IA32 X64 AARCH64 30 32 # 31 33 32 34 [Sources.Common] 33 35 StandaloneMmMemLib.c 36 37 [Sources.IA32, Sources.X64] 38 X86StandaloneMmMemLibInternal.c 34 39 35 40 [Sources.AARCH64] … … 43 48 BaseMemoryLib 44 49 DebugLib 50 HobLib 51 MemoryAllocationLib 52 53 [Guids] 54 gMmCoreDataHobGuid ## SOMETIMES_CONSUMES ## HOB 55 gEfiMmPeiMmramMemoryReserveGuid ## SOMETIMES_CONSUMES ## HOB -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.c
r80721 r89983 1 1 /** @file 2 Runtime DXE part corresponding to Stan aloneMM variable module.2 Runtime DXE part corresponding to StandaloneMM variable module. 3 3 4 4 This module installs variable arch protocol and variable write arch protocol 5 5 to StandaloneMM runtime variable service. 6 6 7 Copyright (c) 2019 , ARMLtd. All rights reserved.7 Copyright (c) 2019 - 2021, Arm Ltd. All rights reserved. 8 8 9 9 SPDX-License-Identifier: BSD-2-Clause-Patent -
trunk/src/VBox/Devices/EFI/FirmwareNew/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
r80721 r89983 1 1 ## @file 2 # Runtime DXE part corresponding to Stan aloneMM variable module.2 # Runtime DXE part corresponding to StandaloneMM variable module. 3 3 # 4 4 # This module installs variable arch protocol and variable write arch protocol 5 5 # to StandaloneMM runtime variable service. 6 6 # 7 # Copyright (c) 2019 , ARMLtd. All rights reserved.7 # Copyright (c) 2019 - 2021, Arm Ltd. All rights reserved. 8 8 # SPDX-License-Identifier: BSD-2-Clause-Patent 9 9 #
Note:
See TracChangeset
for help on using the changeset viewer.