]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg/Sec: Move SEV-ES SEC workarea definition to common header file
authorTom Lendacky <thomas.lendacky@amd.com>
Thu, 7 Jan 2021 18:48:12 +0000 (12:48 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 7 Jan 2021 19:34:39 +0000 (19:34 +0000)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108

In order to allow for the SEV-ES workarea to be used for other purposes
and by other files, move the definition into the BaseMemEncryptSevLib
header file, MemEncryptSevLib.h.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: <07d66f3384bd54da97d540e89b9f3473a6d17231.1610045305.git.thomas.lendacky@amd.com>

OvmfPkg/Include/Library/MemEncryptSevLib.h
OvmfPkg/Sec/SecMain.c

index fc70b0114354cf7b1d33313f01663485da643c1f..a6d82dac7facb85a57e75bc393620eed7479b11c 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Define Secure Encrypted Virtualization (SEV) base library helper function\r
 \r
-  Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2020, AMD Incorporated. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 \r
 #include <Base.h>\r
 \r
+//\r
+// Internal structure for holding SEV-ES information needed during SEC phase\r
+// and valid only during SEC phase and early PEI during platform\r
+// initialization.\r
+//\r
+// This structure is also used by assembler files:\r
+//   OvmfPkg/ResetVector/ResetVector.nasmb\r
+//   OvmfPkg/ResetVector/Ia32/PageTables64.asm\r
+// any changes must stay in sync with its usage.\r
+//\r
+typedef struct _SEC_SEV_ES_WORK_AREA {\r
+  UINT8    SevEsEnabled;\r
+} SEC_SEV_ES_WORK_AREA;\r
+\r
 /**\r
   Returns a boolean to indicate whether SEV-ES is enabled.\r
 \r
index 63aca702072745880150c446392fca6057b7f339..9db67e17b2aa309e079b5d63cb831049ece15894 100644 (file)
@@ -3,6 +3,7 @@
 \r
   Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+  Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -25,6 +26,7 @@
 #include <Library/ExtractGuidedSectionLib.h>\r
 #include <Library/LocalApicLib.h>\r
 #include <Library/CpuExceptionHandlerLib.h>\r
+#include <Library/MemEncryptSevLib.h>\r
 #include <Register/Amd/Ghcb.h>\r
 #include <Register/Amd/Msr.h>\r
 \r
@@ -37,10 +39,6 @@ typedef struct _SEC_IDT_TABLE {
   IA32_IDT_GATE_DESCRIPTOR  IdtTable[SEC_IDT_ENTRY_COUNT];\r
 } SEC_IDT_TABLE;\r
 \r
-typedef struct _SEC_SEV_ES_WORK_AREA {\r
-  UINT8  SevEsEnabled;\r
-} SEC_SEV_ES_WORK_AREA;\r
-\r
 VOID\r
 EFIAPI\r
 SecStartupPhase2 (\r