summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2022-11-07 14:30:26 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-11-14 04:55:34 +0000
commita89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2 (patch)
treef4f1e353a1ce5913cf9b0b3963f0d10d5e6a35c8 /UefiCpuPkg/Library
parentb9e702c3c9bfe7bfb6bbcff44603add64e1787bf (diff)
downloadedk2-a89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2.tar.gz
edk2-a89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2.tar.bz2
edk2-a89f558d3c56d9c16e5f5b7d395c1aa36ccd38f2.zip
OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123 VmgExitLib once was designed to provide interfaces to support #VC handler and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is introduced, this library is updated to support #VE as well. Now the name of VmgExitLib cannot reflect what the lib does. This patch renames VmgExitLib to CcExitLib (Cc means Confidential Computing). This is a simple renaming and there is no logic changes. After renaming all the VmgExitLib related codes are updated with CcExitLib. These changes are in OvmfPkg/UefiCpuPkg/UefiPayloadPkg. Cc: Guo Dong <guo.dong@intel.com> Cc: Sean Rhodes <sean@starlabs.systems> Cc: James Lu <james.lu@intel.com> Cc: Gua Guo <gua.guo@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Reviewed-by: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c (renamed from UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c)33
-rw-r--r--UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf (renamed from UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf)12
-rw-r--r--UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni14
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/AmdSev.c2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/DxeMpLib.c2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.c2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf2
-rw-r--r--UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c2
-rw-r--r--UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c38
-rw-r--r--UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni15
18 files changed, 64 insertions, 74 deletions
diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c
index d661d85974..79eca74e13 100644
--- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c
+++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c
@@ -1,14 +1,15 @@
/** @file
- VMGEXIT Base Support Library.
+ CcExit Base Support Library.
Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Base.h>
#include <Uefi.h>
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
/**
Perform VMGEXIT.
@@ -163,3 +164,31 @@ VmgExitHandleVc (
return EFI_UNSUPPORTED;
}
+
+/**
+ Handle a #VE exception.
+
+ Performs the necessary processing to handle a #VE exception.
+
+ @param[in, out] ExceptionType Pointer to an EFI_EXCEPTION_TYPE to be set
+ as value to use on error.
+ @param[in, out] SystemContext Pointer to EFI_SYSTEM_CONTEXT
+
+ @retval EFI_SUCCESS Exception handled
+ @retval EFI_UNSUPPORTED #VE not supported, (new) exception value to
+ propagate provided
+ @retval EFI_PROTOCOL_ERROR #VE handling failed, (new) exception value to
+ propagate provided
+
+**/
+EFI_STATUS
+EFIAPI
+VmTdExitHandleVe (
+ IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext
+ )
+{
+ *ExceptionType = VE_EXCEPTION;
+
+ return EFI_UNSUPPORTED;
+}
diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
index 4aab601939..ed7f611cbc 100644
--- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
+++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
@@ -1,23 +1,23 @@
## @file
-# VMGEXIT Support Library.
+# CcExit Base Support Library.
#
# Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
+# Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
INF_VERSION = 0x00010005
- BASE_NAME = VmgExitLibNull
- MODULE_UNI_FILE = VmgExitLibNull.uni
+ BASE_NAME = CcExitLibNull
+ MODULE_UNI_FILE = CcExitLibNull.uni
FILE_GUID = 3cd7368f-ef9b-4a9b-9571-2ed93813677e
MODULE_TYPE = BASE
VERSION_STRING = 1.0
- LIBRARY_CLASS = VmgExitLib
+ LIBRARY_CLASS = CcExitLib
[Sources.common]
- VmgExitLibNull.c
- VmTdExitNull.c
+ CcExitLibNull.c
[Packages]
MdePkg/MdePkg.dec
diff --git a/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni
new file mode 100644
index 0000000000..b18ae8792e
--- /dev/null
+++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni
@@ -0,0 +1,14 @@
+// /** @file
+// CcExitLib instance.
+//
+// Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
+// Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "CcExitLib NULL instance"
+
+#string STR_MODULE_DESCRIPTION #language en-US "CcExitLib NULL instance."
+
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
index e7a81bebdb..d0f82095cf 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
@@ -60,4 +60,4 @@
PeCoffGetEntryPointLib
MemoryAllocationLib
DebugLib
- VmgExitLib
+ CcExitLib
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
index 7c2ec3b2db..5339f8e604 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
@@ -52,7 +52,7 @@
HobLib
MemoryAllocationLib
SynchronizationLib
- VmgExitLib
+ CcExitLib
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard # CONSUMES
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c
index a7d0897ef1..2b6d9da5c7 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c
@@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Library/DebugLib.h>
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
#include "CpuExceptionCommon.h"
/**
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
index ad5e0e9ed4..0a9ea79f52 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
@@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <PiPei.h>
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
#include "CpuExceptionCommon.h"
CONST UINTN mDoFarReturnFlag = 0;
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
index 6a170286c8..df44371fe0 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
@@ -48,7 +48,7 @@
PrintLib
LocalApicLib
PeCoffGetEntryPointLib
- VmgExitLib
+ CcExitLib
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
index 9dde07612a..8f8a5dab79 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
@@ -51,7 +51,7 @@
LocalApicLib
PeCoffGetEntryPointLib
DebugLib
- VmgExitLib
+ CcExitLib
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf
index 6d2f66504a..619b39d7f1 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHandlerLib.inf
@@ -53,7 +53,7 @@
PrintLib
LocalApicLib
PeCoffGetEntryPointLib
- VmgExitLib
+ CcExitLib
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard
diff --git a/UefiCpuPkg/Library/MpInitLib/AmdSev.c b/UefiCpuPkg/Library/MpInitLib/AmdSev.c
index 4e4c63a52d..2dd8f4d746 100644
--- a/UefiCpuPkg/Library/MpInitLib/AmdSev.c
+++ b/UefiCpuPkg/Library/MpInitLib/AmdSev.c
@@ -8,7 +8,7 @@
**/
#include "MpLib.h"
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
/**
Get Protected mode code segment with 16-bit default addressing
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
index e1cd0b3500..cd07de3a3c 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
@@ -54,7 +54,7 @@
DebugAgentLib
SynchronizationLib
PcdLib
- VmgExitLib
+ CcExitLib
MicrocodeLib
[Protocols]
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
index 78cc3e2b93..ef56af1f73 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c
@@ -12,7 +12,7 @@
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/DxeServicesTableLib.h>
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
#include <Register/Amd/Fam17Msr.h>
#include <Register/Amd/Ghcb.h>
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index 1c053f87a4..e5dc852ed9 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -9,7 +9,7 @@
**/
#include "MpLib.h"
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
#include <Register/Amd/Fam17Msr.h>
#include <Register/Amd/Ghcb.h>
diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
index 5facf4db94..afd551bb0f 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
@@ -53,7 +53,7 @@
SynchronizationLib
PeiServicesLib
PcdLib
- VmgExitLib
+ CcExitLib
MicrocodeLib
[Pcd]
diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c
index a3cd377ef6..4c4f81af7c 100644
--- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c
+++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c
@@ -9,7 +9,7 @@
**/
#include "MpLib.h"
-#include <Library/VmgExitLib.h>
+#include <Library/CcExitLib.h>
#include <Register/Amd/Fam17Msr.h>
#include <Register/Amd/Ghcb.h>
diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c b/UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c
deleted file mode 100644
index 6a4e8087cb..0000000000
--- a/UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
-
- Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-#include <Base.h>
-#include <Uefi.h>
-#include <Library/VmgExitLib.h>
-
-/**
- Handle a #VE exception.
-
- Performs the necessary processing to handle a #VE exception.
-
- @param[in, out] ExceptionType Pointer to an EFI_EXCEPTION_TYPE to be set
- as value to use on error.
- @param[in, out] SystemContext Pointer to EFI_SYSTEM_CONTEXT
-
- @retval EFI_SUCCESS Exception handled
- @retval EFI_UNSUPPORTED #VE not supported, (new) exception value to
- propagate provided
- @retval EFI_PROTOCOL_ERROR #VE handling failed, (new) exception value to
- propagate provided
-
-**/
-EFI_STATUS
-EFIAPI
-VmTdExitHandleVe (
- IN OUT EFI_EXCEPTION_TYPE *ExceptionType,
- IN OUT EFI_SYSTEM_CONTEXT SystemContext
- )
-{
- *ExceptionType = VE_EXCEPTION;
-
- return EFI_UNSUPPORTED;
-}
diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni b/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni
deleted file mode 100644
index 8639bc0e8c..0000000000
--- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni
+++ /dev/null
@@ -1,15 +0,0 @@
-// /** @file
-// VMGEXIT support library instance.
-//
-// VMGEXIT support library instance.
-//
-// Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.<BR>
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// **/
-
-
-#string STR_MODULE_ABSTRACT #language en-US "VMGEXIT support NULL library instance"
-
-#string STR_MODULE_DESCRIPTION #language en-US "VMGEXIT support NULL library instance."
-