]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Include/Library/TdxHelperLib.h
OvmfPkg/IntelTdx: Add TdxHelperLibNull
[mirror_edk2.git] / OvmfPkg / Include / Library / TdxHelperLib.h
diff --git a/OvmfPkg/Include/Library/TdxHelperLib.h b/OvmfPkg/Include/Library/TdxHelperLib.h
new file mode 100644 (file)
index 0000000..199aade
--- /dev/null
@@ -0,0 +1,70 @@
+/** @file\r
+  TdxHelperLib header file\r
+\r
+  Copyright (c) 2021 - 2023, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef TDX_HELPER_LIB_H\r
+#define TDX_HELPER_LIB_H\r
+\r
+#include <PiPei.h>\r
+\r
+/**\r
+  In Tdx guest, some information need to be passed from host VMM to guest\r
+  firmware. For example, the memory resource, etc. These information are\r
+  prepared by host VMM and put in TdHob which is described in TdxMetadata.\r
+  TDVF processes the TdHob to accept memories.\r
+\r
+  @retval   EFI_SUCCESS   Successfully process the TdHob\r
+  @retval   Others        Other error as indicated\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+TdxHelperProcessTdHob (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  In Tdx guest, TdHob is passed from host VMM to guest firmware and it contains\r
+  the information of the memory resource. From the security perspective before\r
+  it is consumed, it should be measured and extended.\r
+ *\r
+ * @retval EFI_SUCCESS Successfully measure the TdHob\r
+ * @retval Others      Other error as indicated\r
+ */\r
+EFI_STATUS\r
+EFIAPI\r
+TdxHelperMeasureTdHob (\r
+  VOID\r
+  );\r
+\r
+/**\r
+ * In Tdx guest, Configuration FV (CFV) is treated as external input because it\r
+ * may contain the data provided by VMM. From the sucurity perspective Cfv image\r
+ * should be measured before it is consumed.\r
+ *\r
+ * @retval EFI_SUCCESS Successfully measure the CFV image\r
+ * @retval Others      Other error as indicated\r
+ */\r
+EFI_STATUS\r
+EFIAPI\r
+TdxHelperMeasureCfvImage (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Build the GuidHob for tdx measurements which were done in SEC phase.\r
+  The measurement values are stored in WorkArea.\r
+\r
+  @retval EFI_SUCCESS  The GuidHob is built successfully\r
+  @retval Others       Other errors as indicated\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+TdxHelperBuildGuidHobForTdxMeasurement (\r
+  VOID\r
+  );\r
+\r
+#endif\r