]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/WorkArea.h
OvmfPkg: set a default value for the WorkAreaHeader PCD
[mirror_edk2.git] / OvmfPkg / Include / WorkArea.h
1 /** @file
2
3 Work Area structure definition
4
5 Copyright (c) 2021, AMD Inc.
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 **/
9
10 #ifndef __OVMF_WORK_AREA_H__
11 #define __OVMF_WORK_AREA_H__
12
13 //
14 // Guest type for the work area
15 //
16 typedef enum {
17 GUEST_TYPE_NON_ENCRYPTED,
18 GUEST_TYPE_AMD_SEV,
19 GUEST_TYPE_INTEL_TDX,
20
21 } GUEST_TYPE;
22
23 //
24 // Confidential computing work area header definition. Any change
25 // to the structure need to be kept in sync with the
26 // PcdOvmfConfidentialComputingWorkAreaHeader.
27 //
28 // PcdOvmfConfidentialComputingWorkAreaHeader ==
29 // sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER)
30 // PcdOvmfConfidentialComputingWorkAreaHeader defined in:
31 // OvmfPkg/OvmfPkg.dec
32 // OvmfPkg/OvmfPkgDefines.fdf.inc
33 typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {
34 UINT8 GuestType;
35 UINT8 Reserved1[3];
36 } CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER;
37
38 //
39 // Internal structure for holding SEV-ES information needed during SEC phase
40 // and valid only during SEC phase and early PEI during platform
41 // initialization.
42 //
43 // This structure is also used by assembler files:
44 // OvmfPkg/ResetVector/ResetVector.nasmb
45 // OvmfPkg/ResetVector/Ia32/PageTables64.asm
46 // OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
47 // any changes must stay in sync with its usage.
48 //
49 typedef struct _SEC_SEV_ES_WORK_AREA {
50 UINT8 SevEsEnabled;
51 UINT8 Reserved1[7];
52
53 UINT64 RandomData;
54
55 UINT64 EncryptionMask;
56 } SEC_SEV_ES_WORK_AREA;
57
58 //
59 // The SEV work area definition.
60 //
61 typedef struct _SEV_WORK_AREA {
62 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
63
64 SEC_SEV_ES_WORK_AREA SevEsWorkArea;
65 } SEV_WORK_AREA;
66
67 typedef union {
68 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
69 SEV_WORK_AREA SevWorkArea;
70 } OVMF_WORK_AREA;
71
72 #endif