]> xenbits.xensource.com Git - ovmf.git/commitdiff
OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition
authorRoth, Michael via groups.io <Michael.Roth=amd.com@groups.io>
Tue, 25 Apr 2023 20:32:56 +0000 (04:32 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 26 Apr 2023 13:39:01 +0000 (13:39 +0000)
The Confidential Computing blob defined here is intended to match the
definition defined by linux guest kernel. Previously, both definitions
relied on natural alignment, but that relies on both OVMF and kernel
being compiled as 64-bit. While there aren't currently any plans to
enable SNP support for 32-bit compilations, the kernel definition has
since been updated to use explicit padding/reserved fields to avoid
this dependency. Update OVMF to match that definition.

While at it, also fix up the Reserved fields to match the numbering
used in the kernel.

No functional changes (for currently-supported environments, at least).

Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
OvmfPkg/AmdSevDxe/AmdSevDxe.c
OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h

index df807066fa835e25187f4e796cdabea5b12c0463..db3675ae86a9bae3660a4bcf7bc308598bed56bc 100644 (file)
@@ -48,11 +48,13 @@ AllocateConfidentialComputingBlob (
 \r
   CcBlob->Header                 = SIGNATURE_32 ('A', 'M', 'D', 'E');\r
   CcBlob->Version                = 1;\r
-  CcBlob->Reserved1              = 0;\r
+  CcBlob->Reserved               = 0;\r
   CcBlob->SecretsPhysicalAddress = (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfSnpSecretsBase);\r
   CcBlob->SecretsSize            = FixedPcdGet32 (PcdOvmfSnpSecretsSize);\r
+  CcBlob->Reserved1              = 0;\r
   CcBlob->CpuidPhysicalAddress   = (UINT64)(UINTN)FixedPcdGet32 (PcdOvmfCpuidBase);\r
   CcBlob->CpuidLSize             = FixedPcdGet32 (PcdOvmfCpuidSize);\r
+  CcBlob->Reserved2              = 0;\r
 \r
   *CcBlobPtr = CcBlob;\r
 \r
index b328310fd0c2fcf681386fe4bd0d8a2aac978deb..83620e31b891d79bd0d8edba71e25e7c29f84a85 100644 (file)
     { 0x85, 0x54, 0x93, 0xd7, 0x77, 0x91, 0x2d, 0x42 }, \\r
   }\r
 \r
-typedef struct {\r
+typedef PACKED struct {\r
   UINT32    Header;\r
   UINT16    Version;\r
-  UINT16    Reserved1;\r
+  UINT16    Reserved;\r
   UINT64    SecretsPhysicalAddress;\r
   UINT32    SecretsSize;\r
+  UINT32    Reserved1;\r
   UINT64    CpuidPhysicalAddress;\r
   UINT32    CpuidLSize;\r
+  UINT32    Reserved2;\r
 } CONFIDENTIAL_COMPUTING_SNP_BLOB_LOCATION;\r
 \r
 extern EFI_GUID  gConfidentialComputingSevSnpBlobGuid;\r