]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/ResetVector/X64/OvmfSevMetadata.asm
OvmfPkg/ResetVector: pre-validate the data pages used in SEC phase
[mirror_edk2.git] / OvmfPkg / ResetVector / X64 / OvmfSevMetadata.asm
1 ;-----------------------------------------------------------------------------
2 ; @file
3 ; OVMF metadata for the AMD SEV confidential computing guests
4 ;
5 ; Copyright (c) 2021, AMD Inc. All rights reserved.<BR>
6 ;
7 ; SPDX-License-Identifier: BSD-2-Clause-Patent
8 ;-----------------------------------------------------------------------------
9
10 BITS 64
11
12 %define OVMF_SEV_METADATA_VERSION 1
13
14 ; The section must be accepted or validated by the VMM before the boot
15 %define OVMF_SECTION_TYPE_SNP_SEC_MEM 0x1
16
17 ; AMD SEV-SNP specific sections
18 %define OVMF_SECTION_TYPE_SNP_SECRETS 0x2
19
20 ;
21 ; The section contains the hypervisor pre-populated CPUID values.
22 ; In the case of SEV-SNP, the CPUID values are filtered and measured by
23 ; the SEV-SNP firmware.
24 ; The CPUID format is documented in SEV-SNP firmware spec 0.9 section 7.1
25 ; (CPUID function structure).
26 ;
27 %define OVMF_SECTION_TYPE_CPUID 0x3
28
29
30 ALIGN 16
31
32 TIMES (15 - ((OvmfSevGuidedStructureEnd - OvmfSevGuidedStructureStart + 15) % 16)) DB 0
33
34 OvmfSevGuidedStructureStart:
35 ;
36 ; OvmfSev metadata descriptor
37 ;
38 OvmfSevMetadataGuid:
39
40 _DescriptorSev:
41 DB 'A','S','E','V' ; Signature
42 DD OvmfSevGuidedStructureEnd - _DescriptorSev ; Length
43 DD OVMF_SEV_METADATA_VERSION ; Version
44 DD (OvmfSevGuidedStructureEnd - _DescriptorSev - 16) / 12 ; Number of sections
45
46 ; Region need to be pre-validated by the hypervisor
47 PreValidate1:
48 DD SNP_SEC_MEM_BASE_DESC_1
49 DD SNP_SEC_MEM_SIZE_DESC_1
50 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
51 PreValidate2:
52 DD SNP_SEC_MEM_BASE_DESC_2
53 DD SNP_SEC_MEM_SIZE_DESC_2
54 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
55
56 ; SEV-SNP Secrets page
57 SevSnpSecrets:
58 DD SEV_SNP_SECRETS_BASE
59 DD SEV_SNP_SECRETS_SIZE
60 DD OVMF_SECTION_TYPE_SNP_SECRETS
61
62 ; CPUID values
63 CpuidSec:
64 DD CPUID_BASE
65 DD CPUID_SIZE
66 DD OVMF_SECTION_TYPE_CPUID
67
68 ; Region need to be pre-validated by the hypervisor
69 PreValidate3:
70 DD SNP_SEC_MEM_BASE_DESC_3
71 DD SNP_SEC_MEM_SIZE_DESC_3
72 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
73 OvmfSevGuidedStructureEnd:
74 ALIGN 16