+\r
+/**\r
+ The function performs SEV specific region initialization.\r
+\r
+ **/\r
+VOID\r
+SevInitializeRam (\r
+ VOID\r
+ )\r
+{\r
+ if (MemEncryptSevSnpIsEnabled ()) {\r
+ //\r
+ // If SEV-SNP is enabled, reserve the Secrets and CPUID memory area.\r
+ //\r
+ // This memory range is given to the PSP by the hypervisor to populate\r
+ // the information used during the SNP VM boots, and it need to persist\r
+ // across the kexec boots. Mark it as EfiReservedMemoryType so that\r
+ // the guest firmware and OS does not use it as a system memory.\r
+ //\r
+ BuildMemoryAllocationHob (\r
+ (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfSnpSecretsBase),\r
+ (UINT64)(UINTN)PcdGet32 (PcdOvmfSnpSecretsSize),\r
+ EfiReservedMemoryType\r
+ );\r
+ BuildMemoryAllocationHob (\r
+ (EFI_PHYSICAL_ADDRESS)(UINTN)PcdGet32 (PcdOvmfCpuidBase),\r
+ (UINT64)(UINTN)PcdGet32 (PcdOvmfCpuidSize),\r
+ EfiReservedMemoryType\r
+ );\r
+ }\r
+}\r