TianoCore EDK2 master
Loading...
Searching...
No Matches
SevSnpMsr.h
Go to the documentation of this file.
1
17#ifndef SEV_SNP_MSR_H_
18#define SEV_SNP_MSR_H_
19
24#define MSR_SEV_ES_GHCB 0xc0010130
25
29typedef union {
30 struct {
31 UINT32 Function : 12;
32 UINT32 Reserved1 : 20;
33 UINT32 Reserved2 : 32;
34 } GhcbInfo;
35
36 struct {
37 UINT8 Reserved[3];
38 UINT8 SevEncryptionBitPos;
39 UINT16 SevEsProtocolMin;
40 UINT16 SevEsProtocolMax;
41 } GhcbProtocol;
42
43 struct {
44 UINT32 Function : 12;
45 UINT32 ReasonCodeSet : 4;
46 UINT32 ReasonCode : 8;
47 UINT32 Reserved1 : 8;
48 UINT32 Reserved2 : 32;
49 } GhcbTerminate;
50
51 struct {
52 UINT64 Function : 12;
53 UINT64 Features : 52;
54 } GhcbHypervisorFeatures;
55
56 struct {
57 UINT64 Function : 12;
58 UINT64 GuestFrameNumber : 52;
59 } GhcbGpaRegister;
60
61 struct {
62 UINT64 Function : 12;
63 UINT64 GuestFrameNumber : 40;
64 UINT64 Operation : 4;
65 UINT64 Reserved : 8;
66 } SnpPageStateChangeRequest;
67
68 struct {
69 UINT32 Function : 12;
70 UINT32 Reserved : 20;
71 UINT32 ErrorCode;
72 } SnpPageStateChangeResponse;
73
74 struct {
75 UINT64 Function : 12;
76 UINT64 Reserved1 : 20;
77 UINT64 Vmpl : 8;
78 UINT64 Reserved2 : 56;
79 } SnpVmplRequest;
80
81 struct {
82 UINT32 Function : 12;
83 UINT32 Reserved : 20;
84 UINT32 ErrorCode;
85 } SnpVmplResponse;
86
87 VOID *Ghcb;
88
89 UINT64 GhcbPhysicalAddress;
90
91 UINT64 Uint64;
93
94#define GHCB_INFO_SEV_INFO 1
95#define GHCB_INFO_SEV_INFO_GET 2
96#define GHCB_INFO_CPUID_REQUEST 4
97#define GHCB_INFO_CPUID_RESPONSE 5
98#define GHCB_INFO_GHCB_GPA_REGISTER_REQUEST 18
99#define GHCB_INFO_GHCB_GPA_REGISTER_RESPONSE 19
100#define GHCB_INFO_SNP_PAGE_STATE_CHANGE_REQUEST 20
101#define GHCB_INFO_SNP_PAGE_STATE_CHANGE_RESPONSE 21
102#define GHCB_INFO_SNP_VMPL_REQUEST 22
103#define GHCB_INFO_SNP_VMPL_RESPONSE 23
104#define GHCB_HYPERVISOR_FEATURES_REQUEST 128
105#define GHCB_HYPERVISOR_FEATURES_RESPONSE 129
106#define GHCB_INFO_TERMINATE_REQUEST 256
107
108#define GHCB_TERMINATE_GHCB 0
109#define GHCB_TERMINATE_GHCB_GENERAL 0
110#define GHCB_TERMINATE_GHCB_PROTOCOL 1
111
116#define MSR_SEV_STATUS 0xc0010131
117
121typedef union {
125 struct {
129 UINT32 SevBit : 1;
130
134 UINT32 SevEsBit : 1;
135
139 UINT32 SevSnpBit : 1;
140
144 UINT32 vTOM : 1;
145
149 UINT32 ReflectVC : 1;
150
155
160
165
169 UINT32 PreventHostIBS : 1;
170
174 UINT32 SNPBTBIsolation : 1;
175
179 UINT32 VmplSSS : 1;
180
184 UINT32 SecureTsc : 1;
185
190
195
200
204 UINT32 Reserved1 : 1;
205
209 UINT32 VmsaRegProt : 1;
210
214 UINT32 SmtProtection : 1;
219 UINT32 SecureAVIC : 1;
220
221 UINT32 Reserved2 : 4;
222
226 UINT32 IbpbOnEntry : 1;
227
228 UINT32 Reserved3 : 8;
229 } Bits;
233 UINT32 Uint32;
237 UINT64 Uint64;
239
240#endif