]>
Commit | Line | Data |
---|---|---|
80e67af9 BS |
1 | /** @file\r |
2 | \r | |
3 | Work Area structure definition\r | |
4 | \r | |
5 | Copyright (c) 2021, AMD Inc.\r | |
6 | \r | |
7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | **/\r | |
9 | \r | |
10 | #ifndef __OVMF_WORK_AREA_H__\r | |
11 | #define __OVMF_WORK_AREA_H__\r | |
12 | \r | |
d020ac55 | 13 | #include <ConfidentialComputingGuestAttr.h>\r |
6ba931be | 14 | #include <IndustryStandard/Tpm20.h>\r |
80e67af9 BS |
15 | \r |
16 | //\r | |
17 | // Confidential computing work area header definition. Any change\r | |
18 | // to the structure need to be kept in sync with the\r | |
19 | // PcdOvmfConfidentialComputingWorkAreaHeader.\r | |
20 | //\r | |
79019c7a CK |
21 | // PcdOvmfConfidentialComputingWorkAreaHeader ==\r |
22 | // sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER)\r | |
23 | // PcdOvmfConfidentialComputingWorkAreaHeader defined in:\r | |
24 | // OvmfPkg/OvmfPkg.dec\r | |
1ef86f12 | 25 | // OvmfPkg/Include/Fdf/OvmfPkgDefines.fdf.inc\r |
80e67af9 | 26 | typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {\r |
ac0a286f MK |
27 | UINT8 GuestType;\r |
28 | UINT8 Reserved1[3];\r | |
80e67af9 BS |
29 | } CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER;\r |
30 | \r | |
31 | //\r | |
32 | // Internal structure for holding SEV-ES information needed during SEC phase\r | |
33 | // and valid only during SEC phase and early PEI during platform\r | |
34 | // initialization.\r | |
35 | //\r | |
36 | // This structure is also used by assembler files:\r | |
37 | // OvmfPkg/ResetVector/ResetVector.nasmb\r | |
38 | // OvmfPkg/ResetVector/Ia32/PageTables64.asm\r | |
39 | // OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm\r | |
40 | // any changes must stay in sync with its usage.\r | |
41 | //\r | |
42 | typedef struct _SEC_SEV_ES_WORK_AREA {\r | |
63c50d3f BS |
43 | //\r |
44 | // Hold the SevStatus MSR value read by OvmfPkg/ResetVector/Ia32/AmdSev.c\r | |
45 | //\r | |
46 | UINT64 SevStatusMsrValue;\r | |
80e67af9 | 47 | \r |
ac0a286f | 48 | UINT64 RandomData;\r |
80e67af9 | 49 | \r |
ac0a286f | 50 | UINT64 EncryptionMask;\r |
63c50d3f BS |
51 | \r |
52 | //\r | |
53 | // Indicator that the VC handler is called. It is used during the SevFeature\r | |
54 | // detection in OvmfPkg/ResetVector/Ia32/AmdSev.c\r | |
55 | //\r | |
56 | UINT8 ReceivedVc;\r | |
80e67af9 BS |
57 | } SEC_SEV_ES_WORK_AREA;\r |
58 | \r | |
59 | //\r | |
60 | // The SEV work area definition.\r | |
61 | //\r | |
62 | typedef struct _SEV_WORK_AREA {\r | |
ac0a286f | 63 | CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;\r |
80e67af9 | 64 | \r |
ac0a286f | 65 | SEC_SEV_ES_WORK_AREA SevEsWorkArea;\r |
80e67af9 BS |
66 | } SEV_WORK_AREA;\r |
67 | \r | |
6ba931be MX |
68 | //\r |
69 | // Start of TDX Specific WorkArea definition\r | |
70 | //\r | |
71 | \r | |
72 | #define TDX_MEASUREMENT_TDHOB_BITMASK 0x1\r | |
73 | #define TDX_MEASUREMENT_CFVIMG_BITMASK 0x2\r | |
74 | \r | |
75 | typedef struct _TDX_MEASUREMENTS_DATA {\r | |
76 | UINT32 MeasurementsBitmap;\r | |
77 | UINT8 TdHobHashValue[SHA384_DIGEST_SIZE];\r | |
78 | UINT8 CfvImgHashValue[SHA384_DIGEST_SIZE];\r | |
79 | } TDX_MEASUREMENTS_DATA;\r | |
80 | \r | |
580a6b61 MX |
81 | //\r |
82 | // The TDX work area definition\r | |
83 | //\r | |
84 | typedef struct _SEC_TDX_WORK_AREA {\r | |
6ba931be MX |
85 | UINT32 PageTableReady;\r |
86 | UINT32 Gpaw;\r | |
87 | UINT64 HobList;\r | |
88 | TDX_MEASUREMENTS_DATA TdxMeasurementsData;\r | |
580a6b61 MX |
89 | } SEC_TDX_WORK_AREA;\r |
90 | \r | |
91 | typedef struct _TDX_WORK_AREA {\r | |
92 | CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;\r | |
93 | SEC_TDX_WORK_AREA SecTdxWorkArea;\r | |
94 | } TDX_WORK_AREA;\r | |
95 | \r | |
6ba931be MX |
96 | //\r |
97 | // End of TDX Specific WorkArea definition\r | |
98 | //\r | |
99 | \r | |
80e67af9 | 100 | typedef union {\r |
ac0a286f MK |
101 | CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;\r |
102 | SEV_WORK_AREA SevWorkArea;\r | |
580a6b61 | 103 | TDX_WORK_AREA TdxWorkArea;\r |
80e67af9 BS |
104 | } OVMF_WORK_AREA;\r |
105 | \r | |
106 | #endif\r |