]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelper.c
OvmfPkg/IntelTdx: Add SecTdxHelperLib
[mirror_edk2.git] / OvmfPkg / IntelTdx / TdxHelperLib / SecTdxHelper.c
1 /** @file
2 TdxHelper Functions which are used in SEC phase
3
4 Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include <PiPei.h>
11
12 /**
13 In Tdx guest, some information need to be passed from host VMM to guest
14 firmware. For example, the memory resource, etc. These information are
15 prepared by host VMM and put in TdHob which is described in TdxMetadata.
16 TDVF processes the TdHob to accept memories.
17
18 @retval EFI_SUCCESS Successfully process the TdHob
19 @retval Others Other error as indicated
20 **/
21 EFI_STATUS
22 EFIAPI
23 TdxHelperProcessTdHob (
24 VOID
25 )
26 {
27 return EFI_UNSUPPORTED;
28 }
29
30 /**
31 In Tdx guest, TdHob is passed from host VMM to guest firmware and it contains
32 the information of the memory resource. From the security perspective before
33 it is consumed, it should be measured and extended.
34 *
35 * @retval EFI_SUCCESS Successfully measure the TdHob
36 * @retval Others Other error as indicated
37 */
38 EFI_STATUS
39 EFIAPI
40 TdxHelperMeasureTdHob (
41 VOID
42 )
43 {
44 return EFI_UNSUPPORTED;
45 }
46
47 /**
48 * In Tdx guest, Configuration FV (CFV) is treated as external input because it
49 * may contain the data provided by VMM. From the sucurity perspective Cfv image
50 * should be measured before it is consumed.
51 *
52 * @retval EFI_SUCCESS Successfully measure the CFV image
53 * @retval Others Other error as indicated
54 */
55 EFI_STATUS
56 EFIAPI
57 TdxHelperMeasureCfvImage (
58 VOID
59 )
60 {
61 return EFI_UNSUPPORTED;
62 }
63
64 /**
65 Build the GuidHob for tdx measurements which were done in SEC phase.
66 The measurement values are stored in WorkArea.
67
68 @retval EFI_SUCCESS The GuidHob is built successfully
69 @retval Others Other errors as indicated
70 **/
71 EFI_STATUS
72 EFIAPI
73 TdxHelperBuildGuidHobForTdxMeasurement (
74 VOID
75 )
76 {
77 return EFI_UNSUPPORTED;
78 }