Bug Summary

File:home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core/Runtime/PeVmxState.c
Warning:line 296, column 2
Value stored to 'RootGuestIDTRBase_M' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name PeVmxState.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -fno-jump-tables -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -ffreestanding -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/build/StmPkg/Core/Runtime -resource-dir /opt/xgcc/lib/clang/17 -include PcdData.h -D COREBOOT32 -D RELEASE -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/EDKII/BaseTools/Source/C/Include/X64 -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/EdkII/MdePkg/Include -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/EdkII/MdePkg/Include/X64 -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Include -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Include/x64 -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core/Runtime -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core/Runtime/../Init -I /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core/Runtime/. -internal-isystem /opt/xgcc/lib/clang/17/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/13/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -source-date-epoch 1715206807 -Os -fdebug-compilation-dir=/home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/build/StmPkg/Core/Runtime -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-max-loop 10 -analyzer-output=plist-html -faddrsig -o /cb-build/coreboot_scanbuild.0/PURISM_LIBREM15_V4_STM-scanbuildtmp/2024-05-09-081252-3833419-1/report-LkVWP2.plist -x c /home/coreboot/node-root/workspace/coreboot_scanbuild/3rdparty/stm/Stm/StmPkg/Core/Runtime/PeVmxState.c
1/** @file
2
3Gather the hardware state to be passed to the VM/PE for analysis
4
5This program and the accompanying materials
6are licensed and made available under the terms and conditions of the BSD License
7which accompanies this distribution. The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php.
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#include "StmRuntime.h"
16#include "PeStm.h"
17
18#define memcpyCopyMem CopyMem
19
20extern PE_VM_DATA PeVmData[4]; // right now support a max of 3 PE VM (VM 0 is the SMI_HANDLER)
21extern PE_SMI_CONTROL PeSmiControl;
22
23extern void SendSmiToOtherProcessors(UINT32 CpuIndex);
24extern VOIDvoid CpuReadySync(UINT32 Index);
25extern void MapVmcs ();
26extern UINT32 GetVmcsOffset( UINT32 field_encoding);
27
28void SetupGetRootVmxState();
29void PrintVmxState(UINT32 CpuIndex, ROOT_VMX_STATE * RootState);
30
31static UINT32 SetupGetRootVmxStateDone = 0;
32
33static UINT64 VMCS_N_HOST_CR0_OFFSET = 0;
34static UINT64 VMCS_N_HOST_CR3_OFFSET = 0;
35static UINT64 VMCS_N_HOST_CR4_OFFSET = 0;
36static UINT64 VMCS_N_HOST_GDTR_BASE_OFFSET = 0;
37static UINT64 VMCS_N_HOST_IDTR_BASE_OFFSET = 0;
38static UINT64 VMCS_N_HOST_RSP_OFFSET = 0;
39static UINT64 VMCS_N_HOST_RIP_OFFSET = 0;
40static UINT64 VMCS_64_CONTROL_EPT_PTR_OFFSET = 0;
41static UINT64 VMCS_N_GUEST_RIP_OFFSET = 0;
42
43static UINT64 VMCS_N_GUEST_CR0_OFFSET = 0;
44static UINT64 VMCS_N_GUEST_CR3_OFFSET = 0;
45static UINT64 VMCS_N_GUEST_CR4_OFFSET = 0;
46static UINT64 VMCS_N_GUEST_GDTR_BASE_OFFSET = 0;
47static UINT64 VMCS_32_GUEST_GDTR_LIMIT_OFFSET = 0;
48static UINT64 VMCS_N_GUEST_IDTR_BASE_OFFSET = 0;
49static UINT64 VMCS_32_GUEST_LDTR_LIMIT_OFFSET = 0;
50static UINT64 VMCS_N_GUEST_RSP_OFFSET = 0;
51static UINT64 VMCS_64_CONTROL_EXECUTIVE_VMCS_PTR_OFFSET = 0;
52static UINT64 VMCS_64_GUEST_VMCS_LINK_PTR_OFFSET = 0;
53static UINT64 VMCS_OFFSET_READY = 0;
54
55int GetMultiProcessorState(UINT32 CpuIndex)
56{
57 UINT32 PeType = PE_PERM1;
58 UINT64 * NumProcessors = (UINT64 *) PeVmData[PeType].SharedPageStm;
59
60 // = (ROOT_VMX_STATE *) (NumProcessors + sizeof(*NumProcessors));
61 ROOT_VMX_STATE * RootState;
62 UINT32 CpuNum;
63#if 0
64 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Started\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
65 "%ld GetMultiProcessorState - Started\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Started\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
66 CpuIndex))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Started\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
;
67#endif
68 if(PeVmData[PeType].SharedPageStm == NULL((void *) 0))
69 {
70 DEBUG((EFI_D_ERROR,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetMultiProcessorState - SharedPageStm is NULL, not gathering state\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
71 "%ld GetMultiProcessorState - SharedPageStm is NULL, not gathering state\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetMultiProcessorState - SharedPageStm is NULL, not gathering state\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
72 CpuIndex))do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetMultiProcessorState - SharedPageStm is NULL, not gathering state\n"
, CpuIndex); } } while (((BOOLEAN)(0==1)))
;
73 return -2;
74 }
75 // first clear out the data structures and set the number of processors
76
77 //sizeof(*NumProcessors) + sizeof(*NumProcessors));
78 RootState = (ROOT_VMX_STATE *) ((char *)NumProcessors + 64 );
79 *NumProcessors = mHostContextCommon.CpuNum; // number of CPUs
80
81 ZeroMem ((VOIDvoid *)(UINTN) RootState,
82 sizeof(ROOT_VMX_STATE) * mHostContextCommon.CpuNum);
83
84 // make sure that the VMCS offsets are setup
85
86 SetupGetRootVmxState();
87
88 // send an SMI to the other processors
89
90 if(InterlockedCompareExchange32(&PeSmiControl.PeSmiState,
91 PESMINULL0,
92 PESMIPSMI1) != PESMINULL0)
93 {
94 DEBUG((EFI_D_ERROR,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld x - Aborting, SMI handler already there. PeSmiState %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
95 "%ld x - Aborting, SMI handler already there. PeSmiState %ld\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld x - Aborting, SMI handler already there. PeSmiState %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
96 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld x - Aborting, SMI handler already there. PeSmiState %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
97 PeSmiControl.PeSmiState))do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld x - Aborting, SMI handler already there. PeSmiState %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
;
98 return -1; // need to tell about smi handler is already there
99 }
100
101 SendSmiToOtherProcessors(CpuIndex);
102
103 // wait for the other processors to sync up and decide what to do
104 CpuReadySync(CpuIndex);
105
106 // get the local processor state
107
108 GetRootVmxState(CpuIndex, &RootState[CpuIndex]);
109
110 CpuReadySync(CpuIndex); // wait for everyone to finish the job
111 //- PeSmiHandler will set PeSmiState to 0
112 // once everyone has synched up
113
114 for(CpuNum = 0; CpuNum < mHostContextCommon.CpuNum; CpuNum++)
115 {
116 PrintVmxState(CpuNum, &RootState[CpuNum]);
117 }
118#if 0
119 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Completed. PeSmiState: %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
120 "%ld GetMultiProcessorState - Completed. PeSmiState: %ld\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Completed. PeSmiState: %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
121 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Completed. PeSmiState: %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
122 PeSmiControl.PeSmiState))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetMultiProcessorState - Completed. PeSmiState: %ld\n"
, CpuIndex, PeSmiControl.PeSmiState); } } while (((BOOLEAN)(0
==1)))
;
123#endif
124 return 0;
125}
126
127#define MAXVMCSFLUSH6 6
128#define VmcsSizeInPages1 1
129void GetRootVmxState(UINT32 CpuIndex, ROOT_VMX_STATE * RootState)
130{
131 //UINT64 ExecutiveVMCS;
132 UINT64 HostRootVMCS;
133 UINT64 CurrentVMCSSave;
134 UINT64 RootGuestCR0_M;
135 UINT64 RootGuestCR3_M;
136 UINT64 RootGuestCR4_M;
137 UINT64 RootGuestGDTRBase_M;
138 UINT64 RootGuestGDTRLimit_M;
139 UINT64 RootGuestIDTRBase_M;
140 UINT64 RootGuestIDTRLimit_M;
141 UINT64 RootGuestRSP_M;
142 UINT64 RootGuestRIP_M;
143 UINT64 RootContExecVmcs_M;
144 UINT64 RootContLinkVmcs_M;
145
146 UINT32 FlushCount;
147 UINT32 i;
148
149 char * DummyVmcs[MAXVMCSFLUSH6];
150 UINT32 VmxRevId;
151
152 RootState->Vmxon = mHostContextCommon.HostContextPerCpu[CpuIndex].Vmxon;
153 //UINT32 ApicId = (UINT32) (get_apic_id() & 0xFF);
154 RootState->LinkVMCS = VmRead64(VMCS_64_GUEST_VMCS_LINK_PTR_INDEX0x2800);
155
156 // get the executive VMCS
157 RootState->ExecutiveVMCS = VmRead64(VMCS_64_CONTROL_EXECUTIVE_VMCS_PTR_INDEX0x200C);
158
159#if 0
160 DEBUG((EFI_D_ERROR, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n"
, CpuIndex, RootState->Vmxon, RootState->ExecutiveVMCS,
RootState->LinkVMCS); } } while (((BOOLEAN)(0==1)))
161 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n"
, CpuIndex, RootState->Vmxon, RootState->ExecutiveVMCS,
RootState->LinkVMCS); } } while (((BOOLEAN)(0==1)))
162 RootState->Vmxon,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n"
, CpuIndex, RootState->Vmxon, RootState->ExecutiveVMCS,
RootState->LinkVMCS); } } while (((BOOLEAN)(0==1)))
163 RootState->ExecutiveVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n"
, CpuIndex, RootState->Vmxon, RootState->ExecutiveVMCS,
RootState->LinkVMCS); } } while (((BOOLEAN)(0==1)))
164 RootState->LinkVMCS))do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld GetRootVmxState\n VMXON: 0x%016llx\n ExecutiveVMCS: 0x%016llx\n LinkVMCS: 0x%016llx\n"
, CpuIndex, RootState->Vmxon, RootState->ExecutiveVMCS,
RootState->LinkVMCS); } } while (((BOOLEAN)(0==1)))
;
165#endif
166 RootState->RootGuestCR0 = VmReadN(VMCS_N_GUEST_CR0_INDEX0x6800);
167 RootState->RootGuestCR3 = VmReadN(VMCS_N_GUEST_CR3_INDEX0x6802);
168 RootState->RootGuestCR4 = VmReadN(VMCS_N_GUEST_CR4_INDEX0x6804);
169 RootState->RootGuestGDTRBase = VmReadN(VMCS_N_GUEST_GDTR_BASE_INDEX0x6816);
170 RootState->RootGuestGDTRLimit = VmRead32(VMCS_32_GUEST_GDTR_LIMIT_INDEX0x4810);
171 RootState->RootGuestIDTRBase = VmReadN(VMCS_N_GUEST_IDTR_BASE_INDEX0x6818);
172 RootState->RootGuestIDTRLimit = VmRead32(VMCS_32_GUEST_LDTR_LIMIT_INDEX0x480C);
173 RootState->RootGuestRSP = VmReadN(VMCS_N_GUEST_RSP_INDEX0x681C);
174 RootState->RootGuestRIP = VmReadN(VMCS_N_GUEST_RIP_INDEX0x681E);
175 RootState->RootContEPT = VmReadN(VMCS_64_CONTROL_EPT_PTR_INDEX0x201A);
176 // test result
177
178 // save the current working vmcs
179
180 // find the vmcs that contains the root/host datastrucure
181 // this this the host state information for the root VMCS on the host
182 // it contains the information needed to proces the guest vmexit
183
184 if(RootState->ExecutiveVMCS == RootState->Vmxon) // ref: section 34.15.4.7
185 {
186 // we are in root operation, so our VMCS of interest
187 // is in the VNCS-Link field
188
189 if(RootState->LinkVMCS != 0xFFFFFFFFFFFFFFFF)
190 {
191 RootState->VmcsType = 1; // guest-VM being sericed by VMM
192 HostRootVMCS = RootState->LinkVMCS;
193 RootState->VmxState = VMX_STATE_ROOT1;
194 }
195 else
196 {
197 HostRootVMCS = RootState->ExecutiveVMCS;
198 RootState->VmcsType = 2;
199 RootState->VmxState = VMX_STATE_ROOT1;
200 }
201 }
202 else
203 {
204 // in guest operation, so our VMCS of interest
205 // is in the executive-VMCS field
206 RootState->VmcsType = 3;
207 HostRootVMCS = RootState->ExecutiveVMCS;
208 RootState->VmxState = VMX_STATE_GUEST2;
209 }
210
211 AsmVmClear(&(CurrentVMCSSave));
212 AsmVmPtrStore(&CurrentVMCSSave);
213 RootGuestRIP_M = *(UINT64 *)((UINTN)CurrentVMCSSave +
214 (UINTN)VMCS_N_GUEST_RIP_OFFSET);
215
216VmcsFlushStart:
217 FlushCount = 0;
218
219 while((RootState->RootGuestRIP != RootGuestRIP_M) &&
220 (FlushCount < MAXVMCSFLUSH6))
221 {
222 // got here because the in-memory copy of the VMCS is different than
223 // what is in the processor - so we need to flush
224#if 0
225 DEBUG((EFI_D_INFO, "%ld - GetRootState: RootGuestRIPMemory: 0x%016llx, Location: 0x%016llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld - GetRootState: RootGuestRIPMemory: 0x%016llx, Location: 0x%016llx\n"
, CpuIndex, RootGuestRIP_M, ((UINTN)HostRootVMCS + (UINTN)VMCS_N_GUEST_RIP_OFFSET
)); } } while (((BOOLEAN)(0==1)))
226 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld - GetRootState: RootGuestRIPMemory: 0x%016llx, Location: 0x%016llx\n"
, CpuIndex, RootGuestRIP_M, ((UINTN)HostRootVMCS + (UINTN)VMCS_N_GUEST_RIP_OFFSET
)); } } while (((BOOLEAN)(0==1)))
227 RootGuestRIP_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld - GetRootState: RootGuestRIPMemory: 0x%016llx, Location: 0x%016llx\n"
, CpuIndex, RootGuestRIP_M, ((UINTN)HostRootVMCS + (UINTN)VMCS_N_GUEST_RIP_OFFSET
)); } } while (((BOOLEAN)(0==1)))
228 ((UINTN)HostRootVMCS + (UINTN)VMCS_N_GUEST_RIP_OFFSET)))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld - GetRootState: RootGuestRIPMemory: 0x%016llx, Location: 0x%016llx\n"
, CpuIndex, RootGuestRIP_M, ((UINTN)HostRootVMCS + (UINTN)VMCS_N_GUEST_RIP_OFFSET
)); } } while (((BOOLEAN)(0==1)))
;
229#endif
230 // first create a dummy VMCS
231 VmxRevId = AsmReadMsr32(IA32_VMX_BASIC_MSR_INDEX0x480);
232 DummyVmcs[FlushCount] = (char *) AllocatePages(VmcsSizeInPages1);
233
234 if(DummyVmcs[FlushCount] == NULL((void *) 0))
235 {
236 // ran out of memory - release everything and start over
237 // that way someone else hopefully gets a chance to complete
238 DEBUG((EFI_D_ERROR,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: ran out of memory - so free everything and restart - Flushcount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
239 "%ld - GetRootState: ran out of memory - so free everything and restart - Flushcount: %d\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: ran out of memory - so free everything and restart - Flushcount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
240 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: ran out of memory - so free everything and restart - Flushcount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
241 FlushCount))do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: ran out of memory - so free everything and restart - Flushcount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
;
242 if(FlushCount == 0)
243 goto VmcsFlushStart;
244
245 for(i = 0; i < FlushCount; i++)
246 {
247 FreePages(DummyVmcs[i], VmcsSizeInPages1);
248 }
249 goto VmcsFlushStart;
250 }
251
252 memcpyCopyMem(DummyVmcs[FlushCount], &VmxRevId, 4);
253 AsmVmPtrLoad((UINT64 *) &DummyVmcs[FlushCount]);
254 RootGuestRIP_M = *(UINT64 *)((UINTN)CurrentVMCSSave +
255 (UINTN)VMCS_N_GUEST_RIP_OFFSET); // try again
256 FlushCount++;
257 }
258
259 if(RootState->RootGuestRIP != RootGuestRIP_M)
260 DEBUG ((EFI_D_ERROR, "%ld - GetRootState: *ERROR* VMCS Flush failed FlushCount: %d\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: *ERROR* VMCS Flush failed FlushCount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
261 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: *ERROR* VMCS Flush failed FlushCount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
262 FlushCount))do { if (DebugPrintEnabled ()) { DebugPrint (0x80000000, "%ld - GetRootState: *ERROR* VMCS Flush failed FlushCount: %d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
;
263
264 // in any case, reload this and free the dummies if necessary
265 AsmVmPtrLoad(&CurrentVMCSSave);
266
267 if(FlushCount > 0)
268 {
269 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState - Flush necessary to get VMCS in sync. Flushcount=%d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
270 "%ld GetRootVmxState - Flush necessary to get VMCS in sync. Flushcount=%d\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState - Flush necessary to get VMCS in sync. Flushcount=%d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
271 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState - Flush necessary to get VMCS in sync. Flushcount=%d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
272 FlushCount))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState - Flush necessary to get VMCS in sync. Flushcount=%d\n"
, CpuIndex, FlushCount); } } while (((BOOLEAN)(0==1)))
;
273 // release the buffers
274 for(i = 0; i < FlushCount; i++)
275 {
276 AsmVmClear((UINT64 *) &DummyVmcs[i]);
277 FreePages(DummyVmcs[i], VmcsSizeInPages1);
278 }
279 }
280 //AsmVmPtrStore(&CurrentVMCSSave);
281 //AsmVmClear(&(CurrentVMCSSave));
282 //AsmVmPtrLoad(&HostRootVMCS);
283
284 RootState->HostRootVMCS = HostRootVMCS;
285
286 RootGuestCR0_M = *(UINT64 *)((UINTN)HostRootVMCS +
287 (UINTN)VMCS_N_GUEST_CR0_OFFSET);
288 RootGuestCR3_M = *(UINT64 *)((UINTN)HostRootVMCS +
289 (UINTN)VMCS_N_GUEST_CR3_OFFSET);
290 RootGuestCR4_M = *(UINT64 *)((UINTN)HostRootVMCS +
291 (UINTN)VMCS_N_GUEST_CR4_OFFSET);
292 RootGuestGDTRBase_M = *(UINT64 *)((UINTN)HostRootVMCS +
293 (UINTN)VMCS_N_GUEST_GDTR_BASE_OFFSET);
294 RootGuestGDTRLimit_M = (*(UINT64 *)((UINTN)HostRootVMCS +
295 (UINTN)VMCS_32_GUEST_GDTR_LIMIT_OFFSET)) & 0x00000000FFFFFFFF;
296 RootGuestIDTRBase_M = *(UINT64 *)((UINTN)HostRootVMCS +
Value stored to 'RootGuestIDTRBase_M' is never read
297 (UINTN)VMCS_N_GUEST_IDTR_BASE_OFFSET);
298 RootGuestIDTRLimit_M = (*(UINT64 *)((UINTN)HostRootVMCS +
299 (UINTN)VMCS_32_GUEST_LDTR_LIMIT_OFFSET)) & 0x00000000FFFFFFFF;
300 RootGuestRSP_M = *(UINT64 *)((UINTN)HostRootVMCS +
301 (UINTN)VMCS_N_GUEST_RSP_OFFSET);
302 RootGuestRIP_M = *(UINT64 *)((UINTN)HostRootVMCS +
303 (UINTN)VMCS_N_GUEST_RIP_OFFSET);
304 RootContExecVmcs_M = *(UINT64 *)((UINTN)HostRootVMCS +
305 (UINTN)VMCS_64_CONTROL_EXECUTIVE_VMCS_PTR_OFFSET);
306 RootContLinkVmcs_M = *(UINT64 *)((UINTN)HostRootVMCS +
307 (UINTN)VMCS_64_GUEST_VMCS_LINK_PTR_OFFSET);
308
309#ifdef VMCSDEBUGPRINT
310 if(RootState->VmcsType !=2) // only want active Vmcs
311 {
312 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
313 "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
314 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
315 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
316 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
317 RootState->RootGuestCR0,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
318 RootState->RootGuestCR3,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
319 RootState->RootGuestCR4,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
320 RootState->RootGuestGDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
321 RootState->RootGuestGDTRLimit,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
322 RootState->RootGuestIDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
323 RootState->RootGuestIDTRLimit,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
324 RootState->RootGuestRSP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
325 RootState->RootGuestRIP))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
;
326
327 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
328 "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
329 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
330 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
331 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
332 RootState->Vmxon,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
333 RootState->ExecutiveVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
334 RootState->LinkVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
335 RootState->RootContEPT))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
;
336
337 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
338 "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
339 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
340 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
341 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
342 RootGuestCR0_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
343 RootGuestCR3_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
344 RootGuestCR4_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
345 RootGuestGDTRBase_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
346 RootGuestGDTRLimit_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
347 RootGuestIDTRBase_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
348 RootGuestIDTRLimit_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
349 RootGuestRSP_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
350 RootGuestRIP_M))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n G_CR0m %llx\n G_CR3m %llx\n G_CR4m %llx\n G_GDTRm %llx:%llx\n G_IDTRm %llx:%llx\n G_RSPm %llx\n G_RIPm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootGuestCR0_M, RootGuestCR3_M, RootGuestCR4_M, RootGuestGDTRBase_M
, RootGuestGDTRLimit_M, RootGuestIDTRBase_M, RootGuestIDTRLimit_M
, RootGuestRSP_M, RootGuestRIP_M); } } while (((BOOLEAN)(0==1
)))
;
351
352 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
353 "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
354 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
355 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
356 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
357 RootContExecVmcs_M,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
358 RootContLinkVmcs_M))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) (memory) HostRootVmcs 0x%016llx\n C_ExecVMCSm %llx\n C_LinkVMCSm %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootContExecVmcs_M, RootContLinkVmcs_M); } } while (((BOOLEAN
)(0==1)))
;
359 }
360#endif
361
362 // need to save the root vmx host structures
363 if(RootState->VmxState == VMX_STATE_ROOT1)
364 {
365 // if root, these entries are meaningless, so clear them out
366 RootState->RootHostCR0 = 0;
367 RootState->RootHostCR3 = 0;
368 RootState->RootHostCR4 = 0;
369 RootState->RootHostGDTRBase = 0;
370 RootState->RootHostIDTRBase = 0;
371 RootState->RootHostRSP = 0;
372 RootState->RootHostRIP = 0;
373 RootState->RootHostEPT = 0;
374
375 // move the memory/root VMCS elements into place
376
377 RootState->RootGuestCR0 = *(UINT64 *)((UINTN)HostRootVMCS +
378 (UINTN)VMCS_N_GUEST_CR0_OFFSET);
379 RootState->RootGuestCR3 = *(UINT64 *)((UINTN)HostRootVMCS +
380 (UINTN)VMCS_N_GUEST_CR3_OFFSET);
381 RootState->RootGuestCR4 = *(UINT64 *)((UINTN)HostRootVMCS +
382 (UINTN)VMCS_N_GUEST_CR4_OFFSET);
383 RootState->RootGuestGDTRBase = *(UINT64 *)((UINTN)HostRootVMCS +
384 (UINTN)VMCS_N_GUEST_GDTR_BASE_OFFSET);
385 RootState->RootGuestGDTRLimit = (*(UINT64 *)((UINTN)HostRootVMCS +
386 (UINTN)VMCS_32_GUEST_GDTR_LIMIT_OFFSET)) & 0x00000000FFFFFFFF;
387 RootState->RootGuestIDTRBase = *(UINT64 *)((UINTN)HostRootVMCS +
388 (UINTN)VMCS_N_GUEST_IDTR_BASE_OFFSET);
389 RootState->RootGuestIDTRLimit = (*(UINT64 *)((UINTN)HostRootVMCS +
390 (UINTN)VMCS_32_GUEST_LDTR_LIMIT_OFFSET)) & 0x00000000FFFFFFFF;
391 RootState->RootGuestRSP = *(UINT64 *)((UINTN)HostRootVMCS +
392 (UINTN)VMCS_N_GUEST_RSP_OFFSET);
393 RootState->RootGuestRIP = *(UINT64 *)((UINTN)HostRootVMCS +
394 (UINTN)VMCS_N_GUEST_RIP_OFFSET);
395 }
396 else
397 {
398 RootState->RootHostCR0 = *(UINT64 *)((UINTN)HostRootVMCS +
399 (UINTN)VMCS_N_HOST_CR0_OFFSET);
400 RootState->RootHostCR3 = *(UINT64 *)((UINTN)HostRootVMCS +
401 (UINTN)VMCS_N_HOST_CR3_OFFSET);
402 RootState->RootHostCR4 = *(UINT64 *)((UINTN)HostRootVMCS +
403 (UINTN)VMCS_N_HOST_CR4_OFFSET);
404 RootState->RootHostGDTRBase = *(UINTN *)((UINTN)HostRootVMCS +
405 (UINTN)VMCS_N_HOST_GDTR_BASE_OFFSET);
406 RootState->RootHostIDTRBase = *(UINTN *)((UINTN)HostRootVMCS +
407 (UINTN)VMCS_N_HOST_IDTR_BASE_OFFSET);
408
409 RootState->RootHostRSP = *(UINTN*)((UINTN)HostRootVMCS +
410 (UINTN)VMCS_N_HOST_RSP_OFFSET);
411 RootState->RootHostRIP = *(UINTN*)((UINTN)HostRootVMCS +
412 (UINTN)VMCS_N_HOST_RIP_OFFSET);
413 RootState->RootHostEPT = *(UINTN*)((UINTN)HostRootVMCS +
414 (UINTN)VMCS_64_CONTROL_EPT_PTR_OFFSET);
415 }
416 // Indicate to the master that we are all done
417
418 RootState->valid = 1;
419
420 // restore the current working vmcs
421
422 //AsmVmClear(&HostRootVMCS);
423 //AsmVmPtrLoad(&CurrentVMCSSave);
424#ifdef VMCSDEBUGPRINT
425 if(RootState->VmcsType != 2)
426 {
427 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
428 "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
429 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
430 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
431 RootState->RootHostCR0,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
432 RootState->RootHostCR3,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
433 RootState->RootHostCR4,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
434 RootState->RootHostGDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
435 RootState->RootHostIDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
436 RootState->RootHostRSP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
437 RootState->RootHostRIP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
438 RootState->RootHostEPT))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld GetRootVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
;
439 }
440#endif
441}
442
443// setups the offsets needed for accessing in memory the root vmcs state (the host part at least)
444
445void SetupGetRootVmxState()
446{
447 if(SetupGetRootVmxStateDone == 1)
448 return; // already done, so move on
449
450 MapVmcs(); // make sure we have a map
451
452 if(VMCS_OFFSET_READY == 1)
453 return;
454
455 VMCS_N_HOST_CR0_OFFSET = GetVmcsOffset( VMCS_N_HOST_CR0_INDEX0x6C00);
456 VMCS_N_HOST_CR3_OFFSET = GetVmcsOffset( VMCS_N_HOST_CR3_INDEX0x6C02);
457 VMCS_N_HOST_CR4_OFFSET = GetVmcsOffset( VMCS_N_HOST_CR4_INDEX0x6C04);
458 VMCS_N_HOST_GDTR_BASE_OFFSET = GetVmcsOffset( VMCS_N_HOST_GDTR_BASE_INDEX0x6C0C);
459 VMCS_N_HOST_IDTR_BASE_OFFSET = GetVmcsOffset( VMCS_N_HOST_IDTR_BASE_INDEX0x6C0E);
460 VMCS_N_HOST_RSP_OFFSET = GetVmcsOffset( VMCS_N_HOST_RSP_INDEX0x6C14);
461 VMCS_N_HOST_RIP_OFFSET = GetVmcsOffset( VMCS_N_HOST_RIP_INDEX0x6C16);
462 VMCS_64_CONTROL_EPT_PTR_OFFSET = GetVmcsOffset( VMCS_64_CONTROL_EPT_PTR_INDEX0x201A);
463 VMCS_N_GUEST_RIP_OFFSET = GetVmcsOffset(VMCS_N_GUEST_RIP_INDEX0x681E);
464
465 VMCS_N_GUEST_CR0_OFFSET = GetVmcsOffset(VMCS_N_GUEST_CR0_INDEX0x6800);
466 VMCS_N_GUEST_CR3_OFFSET = GetVmcsOffset(VMCS_N_GUEST_CR3_INDEX0x6802);
467 VMCS_N_GUEST_CR4_OFFSET = GetVmcsOffset(VMCS_N_GUEST_CR4_INDEX0x6804);
468 VMCS_N_GUEST_GDTR_BASE_OFFSET = GetVmcsOffset(VMCS_N_GUEST_GDTR_BASE_INDEX0x6816);
469 VMCS_32_GUEST_GDTR_LIMIT_OFFSET = GetVmcsOffset(VMCS_32_GUEST_GDTR_LIMIT_INDEX0x4810);
470 VMCS_N_GUEST_IDTR_BASE_OFFSET = GetVmcsOffset(VMCS_N_GUEST_IDTR_BASE_INDEX0x6818);
471 VMCS_32_GUEST_LDTR_LIMIT_OFFSET = GetVmcsOffset(VMCS_32_GUEST_LDTR_LIMIT_INDEX0x480C);
472 VMCS_N_GUEST_RSP_OFFSET = GetVmcsOffset(VMCS_N_GUEST_RSP_INDEX0x681C);
473 VMCS_64_CONTROL_EXECUTIVE_VMCS_PTR_OFFSET =
474 GetVmcsOffset(VMCS_64_CONTROL_EXECUTIVE_VMCS_PTR_INDEX0x200C);
475 VMCS_64_GUEST_VMCS_LINK_PTR_OFFSET =
476 GetVmcsOffset(VMCS_64_GUEST_VMCS_LINK_PTR_INDEX0x2800);
477 // need to initialize the VMCS Offset table, if it has not already been done
478 VMCS_OFFSET_READY = 1;
479}
480
481void PrintVmxState(UINT32 CpuIndex, ROOT_VMX_STATE * RootState)
482{
483 if(RootState->ExecutiveVMCS == RootState->Vmxon)// ref: section 34.15.4.7
484 {
485 // we are in root operation,
486 //so our VMCS of interest is in the VNCS-Link field
487
488 if(RootState->LinkVMCS != 0xFFFFFFFFFFFFFFFF)
489 {
490 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n"
, CpuIndex, RootState->VmcsType, RootState->LinkVMCS); }
} while (((BOOLEAN)(0==1)))
491 "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n"
, CpuIndex, RootState->VmcsType, RootState->LinkVMCS); }
} while (((BOOLEAN)(0==1)))
492 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n"
, CpuIndex, RootState->VmcsType, RootState->LinkVMCS); }
} while (((BOOLEAN)(0==1)))
493 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n"
, CpuIndex, RootState->VmcsType, RootState->LinkVMCS); }
} while (((BOOLEAN)(0==1)))
494 RootState->LinkVMCS))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: 0x%016llx using VMCS_LINK_POINTER\n"
, CpuIndex, RootState->VmcsType, RootState->LinkVMCS); }
} while (((BOOLEAN)(0==1)))
;
495 }
496 else
497 {
498 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
499 "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
500 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
501 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
502 RootState->ExecutiveVMCS))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is vmxon: But LinkVMCS is 0xFFFFFFFFFFFFFFF so no current Vmcs. Using Executive Vmcs: %llx\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
;
503 }
504 }
505 else
506 {
507 // in guest operation,
508 // so our VMCS of interest is in the executive-VMCS field
509
510 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
511 "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
512 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
513 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
514 RootState->ExecutiveVMCS))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d): execVMCS is guest VMCS: 0x%016llx using Executive VMCS\n"
, CpuIndex, RootState->VmcsType, RootState->ExecutiveVMCS
); } } while (((BOOLEAN)(0==1)))
;
515 }
516
517 if(RootState->VmcsType !=2) // only want active Vmcs
518 {
519 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
520 "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
521 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
522 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
523 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
524 RootState->RootGuestCR0,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
525 RootState->RootGuestCR3,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
526 RootState->RootGuestCR4,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
527 RootState->RootGuestGDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
528 RootState->RootGuestGDTRLimit,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
529 RootState->RootGuestIDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
530 RootState->RootGuestIDTRLimit,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
531 RootState->RootGuestRSP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
532 RootState->RootGuestRIP))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) HostRootVmcs 0x%016llx\n G_CR0 %llx\n G_CR3 %llx\n G_CR4 %llx\n G_GDTR %llx:%llx\n G_IDTR %llx:%llx\n G_RSP %llx\n G_RIP %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->RootGuestCR0, RootState->RootGuestCR3, RootState
->RootGuestCR4, RootState->RootGuestGDTRBase, RootState
->RootGuestGDTRLimit, RootState->RootGuestIDTRBase, RootState
->RootGuestIDTRLimit, RootState->RootGuestRSP, RootState
->RootGuestRIP); } } while (((BOOLEAN)(0==1)))
;
533
534 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
535 "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
536 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
537 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
538 RootState->HostRootVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
539 RootState->Vmxon,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
540 RootState->ExecutiveVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
541 RootState->LinkVMCS,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
542 RootState->RootContEPT))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) (control) HostRootVmcs 0x%016llx\n VMXON %llx\n ExecutiveVMCS %llx\n LinkVMCS %llx\n EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->HostRootVMCS
, RootState->Vmxon, RootState->ExecutiveVMCS, RootState
->LinkVMCS, RootState->RootContEPT); } } while (((BOOLEAN
)(0==1)))
;
543#if 0
544 DEBUG((EFI_D_INFO,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
545 "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n",do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
546 CpuIndex,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
547 RootState->VmcsType,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
548 RootState->RootHostCR0,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
549 RootState->RootHostCR3,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
550 RootState->RootHostCR4,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
551 RootState->RootHostGDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
552 RootState->RootHostIDTRBase,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
553 RootState->RootHostRSP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
554 RootState->RootHostRIP,do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
555 RootState->RootHostEPT))do { if (DebugPrintEnabled ()) { DebugPrint (0x00000040, "%ld PrintVmxState (%d) \n H_CR0 %llx\n H_CR3 %llx\n H_CR4 %llx\n H_GDTR %llx\n H_IDTR %llx\n H_RSP %llx\n H_RIP %llx\n H_EPT %llx\n"
, CpuIndex, RootState->VmcsType, RootState->RootHostCR0
, RootState->RootHostCR3, RootState->RootHostCR4, RootState
->RootHostGDTRBase, RootState->RootHostIDTRBase, RootState
->RootHostRSP, RootState->RootHostRIP, RootState->RootHostEPT
); } } while (((BOOLEAN)(0==1)))
;
556#endif
557 }
558}
559