]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/WorkArea.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[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 #include <ConfidentialComputingGuestAttr.h>
14
15 //
16 // Confidential computing work area header definition. Any change
17 // to the structure need to be kept in sync with the
18 // PcdOvmfConfidentialComputingWorkAreaHeader.
19 //
20 // PcdOvmfConfidentialComputingWorkAreaHeader ==
21 // sizeof (CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER)
22 // PcdOvmfConfidentialComputingWorkAreaHeader defined in:
23 // OvmfPkg/OvmfPkg.dec
24 // OvmfPkg/OvmfPkgDefines.fdf.inc
25 typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {
26 UINT8 GuestType;
27 UINT8 Reserved1[3];
28 } CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER;
29
30 //
31 // Internal structure for holding SEV-ES information needed during SEC phase
32 // and valid only during SEC phase and early PEI during platform
33 // initialization.
34 //
35 // This structure is also used by assembler files:
36 // OvmfPkg/ResetVector/ResetVector.nasmb
37 // OvmfPkg/ResetVector/Ia32/PageTables64.asm
38 // OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
39 // any changes must stay in sync with its usage.
40 //
41 typedef struct _SEC_SEV_ES_WORK_AREA {
42 //
43 // Hold the SevStatus MSR value read by OvmfPkg/ResetVector/Ia32/AmdSev.c
44 //
45 UINT64 SevStatusMsrValue;
46
47 UINT64 RandomData;
48
49 UINT64 EncryptionMask;
50
51 //
52 // Indicator that the VC handler is called. It is used during the SevFeature
53 // detection in OvmfPkg/ResetVector/Ia32/AmdSev.c
54 //
55 UINT8 ReceivedVc;
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 //
68 // The TDX work area definition
69 //
70 typedef struct _SEC_TDX_WORK_AREA {
71 UINT32 PageTableReady;
72 UINT32 Gpaw;
73 UINT64 HobList;
74 } SEC_TDX_WORK_AREA;
75
76 typedef struct _TDX_WORK_AREA {
77 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
78 SEC_TDX_WORK_AREA SecTdxWorkArea;
79 } TDX_WORK_AREA;
80
81 typedef union {
82 CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
83 SEV_WORK_AREA SevWorkArea;
84 TDX_WORK_AREA TdxWorkArea;
85 } OVMF_WORK_AREA;
86
87 #endif