]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/ResetVector/ResetVector.nasmb
OvmfPkg/ResetVector: pre-validate the data pages used in SEC phase
[mirror_edk2.git] / OvmfPkg / ResetVector / ResetVector.nasmb
index fbaeab5f5168c848333471cb4e640455c08d6600..cc364748b5925c9bde013ac972b1ab3ca8f72fb8 100644 (file)
   %define SEV_SNP_SECRETS_SIZE  (FixedPcdGet32 (PcdOvmfSnpSecretsSize))\r
   %define CPUID_BASE  (FixedPcdGet32 (PcdOvmfCpuidBase))\r
   %define CPUID_SIZE  (FixedPcdGet32 (PcdOvmfCpuidSize))\r
+  %define SNP_SEC_MEM_BASE_DESC_1 (FixedPcdGet32 (PcdOvmfSecPageTablesBase))\r
+  %define SNP_SEC_MEM_SIZE_DESC_1 (FixedPcdGet32 (PcdOvmfSecGhcbBase) - SNP_SEC_MEM_BASE_DESC_1)\r
+  ;\r
+  ; The PcdOvmfSecGhcbBase reserves two GHCB pages. The first page is used\r
+  ; as GHCB shared page and second is used for bookkeeping to support the\r
+  ; nested GHCB in SEC phase. The bookkeeping page is mapped private. The VMM\r
+  ; does not need to validate the shared page but it need to validate the\r
+  ; bookkeeping page.\r
+  ;\r
+  %define SNP_SEC_MEM_BASE_DESC_2 (GHCB_BASE + 0x1000)\r
+  %define SNP_SEC_MEM_SIZE_DESC_2 (SEV_SNP_SECRETS_BASE - SNP_SEC_MEM_BASE_DESC_2)\r
+  %define SNP_SEC_MEM_BASE_DESC_3 (CPUID_BASE + CPUID_SIZE)\r
+  %define SNP_SEC_MEM_SIZE_DESC_3 (FixedPcdGet32 (PcdOvmfPeiMemFvBase) - SNP_SEC_MEM_BASE_DESC_3)\r
 \r
 %include "X64/IntelTdxMetadata.asm"\r
 %include "Ia32/Flat32ToFlat64.asm"\r