DB 0x86, 0x5e, 0x46, 0x85, 0xa7, 0xbf, 0x8e, 0xc2\r
tdxMetadataOffsetEnd:\r
\r
+;\r
+; SEV metadata descriptor\r
+;\r
+; Provide the start offset of the metadata blob within the OVMF binary.\r
+\r
+; GUID : dc886566-984a-4798-A75e-5585a7bf67cc\r
+;\r
+OvmfSevMetadataOffsetStart:\r
+ DD (fourGigabytes - OvmfSevMetadataGuid)\r
+ DW OvmfSevMetadataOffsetEnd - OvmfSevMetadataOffsetStart\r
+ DB 0x66, 0x65, 0x88, 0xdc, 0x4a, 0x98, 0x98, 0x47\r
+ DB 0xA7, 0x5e, 0x55, 0x85, 0xa7, 0xbf, 0x67, 0xcc\r
+OvmfSevMetadataOffsetEnd:\r
+\r
%endif\r
\r
; SEV Hash Table Block\r
%include "Ia32/AmdSev.asm"\r
%include "Ia32/PageTables64.asm"\r
%include "Ia32/IntelTdx.asm"\r
+%include "X64/OvmfSevMetadata.asm"\r
%endif\r
\r
%include "Ia16/Real16ToFlat32.asm"\r
--- /dev/null
+;-----------------------------------------------------------------------------\r
+; @file\r
+; OVMF metadata for the AMD SEV confidential computing guests\r
+;\r
+; Copyright (c) 2021, AMD Inc. All rights reserved.<BR>\r
+;\r
+; SPDX-License-Identifier: BSD-2-Clause-Patent\r
+;-----------------------------------------------------------------------------\r
+\r
+BITS 64\r
+\r
+%define OVMF_SEV_METADATA_VERSION 1\r
+\r
+; The section must be accepted or validated by the VMM before the boot\r
+%define OVMF_SECTION_TYPE_SNP_SEC_MEM 0x1\r
+\r
+ALIGN 16\r
+\r
+TIMES (15 - ((OvmfSevGuidedStructureEnd - OvmfSevGuidedStructureStart + 15) % 16)) DB 0\r
+\r
+OvmfSevGuidedStructureStart:\r
+;\r
+; OvmfSev metadata descriptor\r
+;\r
+OvmfSevMetadataGuid:\r
+\r
+_DescriptorSev:\r
+ DB 'A','S','E','V' ; Signature\r
+ DD OvmfSevGuidedStructureEnd - _DescriptorSev ; Length\r
+ DD OVMF_SEV_METADATA_VERSION ; Version\r
+ DD (OvmfSevGuidedStructureEnd - _DescriptorSev - 16) / 12 ; Number of sections\r
+\r
+OvmfSevGuidedStructureEnd:\r
+ ALIGN 16\r