VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/ResetVector/X64/OvmfSevMetadata.asm

Last change on this file was 105670, checked in by vboxsync, 7 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-asm
File size: 2.6 KB
Line 
1;-----------------------------------------------------------------------------
2; @file
3; OVMF metadata for the AMD SEV confidential computing guests
4;
5; Copyright (c) 2021 - 2024, AMD Inc. All rights reserved.<BR>
6;
7; SPDX-License-Identifier: BSD-2-Clause-Patent
8;-----------------------------------------------------------------------------
9
10BITS 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; The SVSM Calling Area Address (CAA)
30%define OVMF_SECTION_TYPE_SVSM_CAA 0x4
31
32; Kernel hashes section for measured direct boot
33%define OVMF_SECTION_TYPE_KERNEL_HASHES 0x10
34
35ALIGN 16
36
37TIMES (15 - ((OvmfSevGuidedStructureEnd - OvmfSevGuidedStructureStart + 15) % 16)) DB 0
38
39OvmfSevGuidedStructureStart:
40;
41; OvmfSev metadata descriptor
42;
43OvmfSevMetadataGuid:
44
45_DescriptorSev:
46 DB 'A','S','E','V' ; Signature
47 DD OvmfSevGuidedStructureEnd - _DescriptorSev ; Length
48 DD OVMF_SEV_METADATA_VERSION ; Version
49 DD (OvmfSevGuidedStructureEnd - _DescriptorSev - 16) / 12 ; Number of sections
50
51; Region need to be pre-validated by the hypervisor
52PreValidate1:
53 DD SNP_SEC_MEM_BASE_DESC_1
54 DD SNP_SEC_MEM_SIZE_DESC_1
55 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
56PreValidate2:
57 DD SNP_SEC_MEM_BASE_DESC_2
58 DD SNP_SEC_MEM_SIZE_DESC_2
59 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
60
61; SEV-SNP Secrets page
62SevSnpSecrets:
63 DD SEV_SNP_SECRETS_BASE
64 DD SEV_SNP_SECRETS_SIZE
65 DD OVMF_SECTION_TYPE_SNP_SECRETS
66
67; CPUID values
68CpuidSec:
69 DD CPUID_BASE
70 DD CPUID_SIZE
71 DD OVMF_SECTION_TYPE_CPUID
72
73; SVSM CAA page
74SvsmCaa:
75 DD SVSM_CAA_BASE
76 DD SVSM_CAA_SIZE
77 DD OVMF_SECTION_TYPE_SVSM_CAA
78
79%if (SEV_SNP_KERNEL_HASHES_BASE > 0)
80; Kernel hashes for measured direct boot, or zero page if
81; there are no kernel hashes / SEV secrets
82SevSnpKernelHashes:
83 DD SEV_SNP_KERNEL_HASHES_BASE
84 DD SEV_SNP_KERNEL_HASHES_SIZE
85 DD OVMF_SECTION_TYPE_KERNEL_HASHES
86%endif
87
88; Region need to be pre-validated by the hypervisor
89PreValidate3:
90 DD SNP_SEC_MEM_BASE_DESC_3
91 DD SNP_SEC_MEM_SIZE_DESC_3
92 DD OVMF_SECTION_TYPE_SNP_SEC_MEM
93OvmfSevGuidedStructureEnd:
94 ALIGN 16
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette