]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/AmdSev/SecretPei: build hob for full page
authorDov Murik <dovmurik@linux.ibm.com>
Wed, 30 Jun 2021 12:36:45 +0000 (12:36 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 29 Jul 2021 09:49:50 +0000 (09:49 +0000)
Round up the size of the SEV launch secret area to a whole page, as
required by BuildMemoryAllocationHob.  This will allow the secret
area defined in the MEMFD to take less than a whole 4KB page.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ashish Kalra <ashish.kalra@amd.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457
Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
OvmfPkg/AmdSev/SecretPei/SecretPei.c

index ad491515dd5d09d6fb3a47edccccfc1b3ae1b89b..db94c26b54d12767a3fac81634d22732e984a5fc 100644 (file)
@@ -4,6 +4,7 @@
   Copyright (C) 2020 James Bottomley, IBM Corporation.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
+#include <Base.h>\r
 #include <PiPei.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/PcdLib.h>\r
@@ -17,7 +18,7 @@ InitializeSecretPei (
 {\r
   BuildMemoryAllocationHob (\r
     PcdGet32 (PcdSevLaunchSecretBase),\r
-    PcdGet32 (PcdSevLaunchSecretSize),\r
+    ALIGN_VALUE (PcdGet32 (PcdSevLaunchSecretSize), EFI_PAGE_SIZE),\r
     EfiBootServicesData\r
     );\r
 \r