1 | /** @file
|
---|
2 | * CPUM - CPU Monitor(/ Manager).
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___VBox_cpum_h
|
---|
27 | #define ___VBox_cpum_h
|
---|
28 |
|
---|
29 | #include <VBox/cdefs.h>
|
---|
30 | #include <VBox/types.h>
|
---|
31 | #include <VBox/x86.h>
|
---|
32 |
|
---|
33 |
|
---|
34 | __BEGIN_DECLS
|
---|
35 |
|
---|
36 | /** @defgroup grp_cpum The CPU Monitor(/Manager) API
|
---|
37 | * @{
|
---|
38 | */
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Selector hidden registers.
|
---|
42 | */
|
---|
43 | typedef struct CPUMSELREGHIDDEN
|
---|
44 | {
|
---|
45 | /** Base register. */
|
---|
46 | uint32_t u32Base;
|
---|
47 | /** Limit (expanded). */
|
---|
48 | uint32_t u32Limit;
|
---|
49 | /** Flags.
|
---|
50 | * This is the high 32-bit word of the descriptor entry.
|
---|
51 | * Only the flags, dpl and type are used. */
|
---|
52 | X86DESCATTR Attr;
|
---|
53 | } CPUMSELREGHID;
|
---|
54 | /** Pointer to selector hidden registers. */
|
---|
55 | typedef CPUMSELREGHID *PCPUMSELREGHID;
|
---|
56 | /** Pointer to const selector hidden registers. */
|
---|
57 | typedef const CPUMSELREGHID *PCCPUMSELREGHID;
|
---|
58 |
|
---|
59 |
|
---|
60 | /**
|
---|
61 | * The sysenter register set.
|
---|
62 | */
|
---|
63 | typedef struct CPUMSYSENTER
|
---|
64 | {
|
---|
65 | /** Ring 0 cs.
|
---|
66 | * This value + 8 is the Ring 0 ss.
|
---|
67 | * This value + 16 is the Ring 3 cs.
|
---|
68 | * This value + 24 is the Ring 3 ss.
|
---|
69 | */
|
---|
70 | uint64_t cs;
|
---|
71 | /** Ring 0 eip. */
|
---|
72 | uint64_t eip;
|
---|
73 | /** Ring 0 esp. */
|
---|
74 | uint64_t esp;
|
---|
75 | } CPUMSYSENTER;
|
---|
76 |
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * CPU context core.
|
---|
80 | */
|
---|
81 | #pragma pack(1)
|
---|
82 | typedef struct CPUMCTXCORE
|
---|
83 | {
|
---|
84 | uint32_t edi;
|
---|
85 | uint32_t esi;
|
---|
86 | uint32_t ebp;
|
---|
87 | uint32_t eax;
|
---|
88 | uint32_t ebx;
|
---|
89 | uint32_t edx;
|
---|
90 | uint32_t ecx;
|
---|
91 |
|
---|
92 | uint32_t esp;
|
---|
93 | RTSEL ss;
|
---|
94 | RTSEL ssPadding;
|
---|
95 |
|
---|
96 | RTSEL gs;
|
---|
97 | RTSEL gsPadding;
|
---|
98 | RTSEL fs;
|
---|
99 | RTSEL fsPadding;
|
---|
100 | RTSEL es;
|
---|
101 | RTSEL esPadding;
|
---|
102 | RTSEL ds;
|
---|
103 | RTSEL dsPadding;
|
---|
104 | RTSEL cs;
|
---|
105 | RTSEL csPadding;
|
---|
106 |
|
---|
107 | X86EFLAGS eflags;
|
---|
108 | uint32_t eip;
|
---|
109 |
|
---|
110 | /** Hidden selector registers.
|
---|
111 | * @{ */
|
---|
112 | CPUMSELREGHID esHid;
|
---|
113 | CPUMSELREGHID csHid;
|
---|
114 | CPUMSELREGHID ssHid;
|
---|
115 | CPUMSELREGHID dsHid;
|
---|
116 | CPUMSELREGHID fsHid;
|
---|
117 | CPUMSELREGHID gsHid;
|
---|
118 | /** @} */
|
---|
119 |
|
---|
120 | } CPUMCTXCORE;
|
---|
121 | /** Pointer to CPU context core. */
|
---|
122 | typedef CPUMCTXCORE *PCPUMCTXCORE;
|
---|
123 | /** Pointer to const CPU context core. */
|
---|
124 | typedef const CPUMCTXCORE *PCCPUMCTXCORE;
|
---|
125 | #pragma pack()
|
---|
126 |
|
---|
127 | /**
|
---|
128 | * CPU context.
|
---|
129 | */
|
---|
130 | #pragma pack(1)
|
---|
131 | typedef struct CPUMCTX
|
---|
132 | {
|
---|
133 | /** FPU state. (16-byte alignment)
|
---|
134 | * @todo This doesn't have to be in X86FXSTATE on CPUs without fxsr - we need a type for the
|
---|
135 | * actual format or convert it (waste of time). */
|
---|
136 | X86FXSTATE fpu;
|
---|
137 |
|
---|
138 | /** CPUMCTXCORE Part.
|
---|
139 | * @{ */
|
---|
140 | uint32_t edi;
|
---|
141 | uint32_t esi;
|
---|
142 | uint32_t ebp;
|
---|
143 | uint32_t eax;
|
---|
144 | uint32_t ebx;
|
---|
145 | uint32_t edx;
|
---|
146 | uint32_t ecx;
|
---|
147 |
|
---|
148 | uint32_t esp;
|
---|
149 | RTSEL ss;
|
---|
150 | RTSEL ssPadding;
|
---|
151 |
|
---|
152 | RTSEL gs;
|
---|
153 | RTSEL gsPadding;
|
---|
154 | RTSEL fs;
|
---|
155 | RTSEL fsPadding;
|
---|
156 | RTSEL es;
|
---|
157 | RTSEL esPadding;
|
---|
158 | RTSEL ds;
|
---|
159 | RTSEL dsPadding;
|
---|
160 | RTSEL cs;
|
---|
161 | RTSEL csPadding;
|
---|
162 |
|
---|
163 | X86EFLAGS eflags;
|
---|
164 | uint32_t eip;
|
---|
165 |
|
---|
166 | /** Hidden selector registers.
|
---|
167 | * @{ */
|
---|
168 | CPUMSELREGHID esHid;
|
---|
169 | CPUMSELREGHID csHid;
|
---|
170 | CPUMSELREGHID ssHid;
|
---|
171 | CPUMSELREGHID dsHid;
|
---|
172 | CPUMSELREGHID fsHid;
|
---|
173 | CPUMSELREGHID gsHid;
|
---|
174 | /** @} */
|
---|
175 |
|
---|
176 | /** @} */
|
---|
177 |
|
---|
178 | /** Control registers.
|
---|
179 | * @{ */
|
---|
180 | uint32_t cr0;
|
---|
181 | uint32_t cr2;
|
---|
182 | uint32_t cr3;
|
---|
183 | uint32_t cr4;
|
---|
184 | /** @} */
|
---|
185 |
|
---|
186 | /** Debug registers.
|
---|
187 | * @{ */
|
---|
188 | uint32_t dr0;
|
---|
189 | uint32_t dr1;
|
---|
190 | uint32_t dr2;
|
---|
191 | uint32_t dr3;
|
---|
192 | uint32_t dr4; /**< @todo remove dr4 and dr5. */
|
---|
193 | uint32_t dr5;
|
---|
194 | uint32_t dr6;
|
---|
195 | uint32_t dr7;
|
---|
196 | /** @} */
|
---|
197 |
|
---|
198 | /** Global Descriptor Table register. */
|
---|
199 | VBOXGDTR gdtr;
|
---|
200 | uint16_t gdtrPadding;
|
---|
201 | uint32_t gdtrPadding64;/** @todo fix this hack */
|
---|
202 | /** Interrupt Descriptor Table register. */
|
---|
203 | VBOXIDTR idtr;
|
---|
204 | uint16_t idtrPadding;
|
---|
205 | uint32_t idtrPadding64;/** @todo fix this hack */
|
---|
206 | /** The task register.
|
---|
207 | * Only the guest context uses all the members. */
|
---|
208 | RTSEL ldtr;
|
---|
209 | RTSEL ldtrPadding;
|
---|
210 | /** The task register.
|
---|
211 | * Only the guest context uses all the members. */
|
---|
212 | RTSEL tr;
|
---|
213 | RTSEL trPadding;
|
---|
214 |
|
---|
215 | /** The sysenter msr registers.
|
---|
216 | * This member is not used by the hypervisor context. */
|
---|
217 | CPUMSYSENTER SysEnter;
|
---|
218 |
|
---|
219 | /** Hidden selector registers.
|
---|
220 | * @{ */
|
---|
221 | CPUMSELREGHID ldtrHid;
|
---|
222 | CPUMSELREGHID trHid;
|
---|
223 | /** @} */
|
---|
224 |
|
---|
225 | /* padding to get 32byte aligned size */
|
---|
226 | uint32_t padding[6];
|
---|
227 | } CPUMCTX;
|
---|
228 | #pragma pack()
|
---|
229 | /** Pointer to CPUMCTX. */
|
---|
230 | typedef CPUMCTX *PCPUMCTX;
|
---|
231 |
|
---|
232 | /**
|
---|
233 | * Gets the CPUMCTXCORE part of a CPUMCTX.
|
---|
234 | */
|
---|
235 | #define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->edi)
|
---|
236 |
|
---|
237 | /**
|
---|
238 | * The register set returned by a CPUID operation.
|
---|
239 | */
|
---|
240 | typedef struct CPUMCPUID
|
---|
241 | {
|
---|
242 | uint32_t eax;
|
---|
243 | uint32_t ebx;
|
---|
244 | uint32_t ecx;
|
---|
245 | uint32_t edx;
|
---|
246 | } CPUMCPUID;
|
---|
247 | /** Pointer to a CPUID leaf. */
|
---|
248 | typedef CPUMCPUID *PCPUMCPUID;
|
---|
249 | /** Pointer to a const CPUID leaf. */
|
---|
250 | typedef const CPUMCPUID *PCCPUMCPUID;
|
---|
251 |
|
---|
252 | /**
|
---|
253 | * CPUID feature to set or clear.
|
---|
254 | */
|
---|
255 | typedef enum CPUMCPUIDFEATURE
|
---|
256 | {
|
---|
257 | CPUMCPUIDFEATURE_INVALID = 0,
|
---|
258 | /** The APIC feature bit. (Std+Ext) */
|
---|
259 | CPUMCPUIDFEATURE_APIC,
|
---|
260 | /** The sysenter/sysexit feature bit. (Std+Ext) */
|
---|
261 | CPUMCPUIDFEATURE_SEP
|
---|
262 | } CPUMCPUIDFEATURE;
|
---|
263 |
|
---|
264 |
|
---|
265 | /** @name Guest Register Getters.
|
---|
266 | * @{ */
|
---|
267 | CPUMDECL(void) CPUMGetGuestGDTR(PVM pVM, PVBOXGDTR pGDTR);
|
---|
268 | CPUMDECL(uint32_t) CPUMGetGuestIDTR(PVM pVM, uint16_t *pcbLimit);
|
---|
269 | CPUMDECL(RTSEL) CPUMGetGuestTR(PVM pVM);
|
---|
270 | CPUMDECL(RTSEL) CPUMGetGuestLDTR(PVM pVM);
|
---|
271 | CPUMDECL(uint32_t) CPUMGetGuestCR0(PVM pVM);
|
---|
272 | CPUMDECL(uint32_t) CPUMGetGuestCR2(PVM pVM);
|
---|
273 | CPUMDECL(uint32_t) CPUMGetGuestCR3(PVM pVM);
|
---|
274 | CPUMDECL(uint32_t) CPUMGetGuestCR4(PVM pVM);
|
---|
275 | CPUMDECL(int) CPUMGetGuestCRx(PVM pVM, uint32_t iReg, uint32_t *pValue);
|
---|
276 | CPUMDECL(uint32_t) CPUMGetGuestEFlags(PVM pVM);
|
---|
277 | CPUMDECL(uint32_t) CPUMGetGuestEIP(PVM pVM);
|
---|
278 | CPUMDECL(uint32_t) CPUMGetGuestEAX(PVM pVM);
|
---|
279 | CPUMDECL(uint32_t) CPUMGetGuestEBX(PVM pVM);
|
---|
280 | CPUMDECL(uint32_t) CPUMGetGuestECX(PVM pVM);
|
---|
281 | CPUMDECL(uint32_t) CPUMGetGuestEDX(PVM pVM);
|
---|
282 | CPUMDECL(uint32_t) CPUMGetGuestESI(PVM pVM);
|
---|
283 | CPUMDECL(uint32_t) CPUMGetGuestEDI(PVM pVM);
|
---|
284 | CPUMDECL(uint32_t) CPUMGetGuestESP(PVM pVM);
|
---|
285 | CPUMDECL(uint32_t) CPUMGetGuestEBP(PVM pVM);
|
---|
286 | CPUMDECL(RTSEL) CPUMGetGuestCS(PVM pVM);
|
---|
287 | CPUMDECL(RTSEL) CPUMGetGuestDS(PVM pVM);
|
---|
288 | CPUMDECL(RTSEL) CPUMGetGuestES(PVM pVM);
|
---|
289 | CPUMDECL(RTSEL) CPUMGetGuestFS(PVM pVM);
|
---|
290 | CPUMDECL(RTSEL) CPUMGetGuestGS(PVM pVM);
|
---|
291 | CPUMDECL(RTSEL) CPUMGetGuestSS(PVM pVM);
|
---|
292 | CPUMDECL(RTUINTREG) CPUMGetGuestDR0(PVM pVM);
|
---|
293 | CPUMDECL(RTUINTREG) CPUMGetGuestDR1(PVM pVM);
|
---|
294 | CPUMDECL(RTUINTREG) CPUMGetGuestDR2(PVM pVM);
|
---|
295 | CPUMDECL(RTUINTREG) CPUMGetGuestDR3(PVM pVM);
|
---|
296 | CPUMDECL(RTUINTREG) CPUMGetGuestDR6(PVM pVM);
|
---|
297 | CPUMDECL(RTUINTREG) CPUMGetGuestDR7(PVM pVM);
|
---|
298 | CPUMDECL(int) CPUMGetGuestDRx(PVM pVM, uint32_t iReg, uint32_t *pValue);
|
---|
299 | CPUMDECL(void) CPUMGetGuestCpuId(PVM pVM, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx);
|
---|
300 | CPUMDECL(GCPTRTYPE(PCCPUMCPUID)) CPUMGetGuestCpuIdStdGCPtr(PVM pVM);
|
---|
301 | CPUMDECL(GCPTRTYPE(PCCPUMCPUID)) CPUMGetGuestCpuIdExtGCPtr(PVM pVM);
|
---|
302 | CPUMDECL(GCPTRTYPE(PCCPUMCPUID)) CPUMGetGuestCpuIdCentaurGCPtr(PVM pVM);
|
---|
303 | CPUMDECL(GCPTRTYPE(PCCPUMCPUID)) CPUMGetGuestCpuIdDefGCPtr(PVM pVM);
|
---|
304 | CPUMDECL(uint32_t) CPUMGetGuestCpuIdStdMax(PVM pVM);
|
---|
305 | CPUMDECL(uint32_t) CPUMGetGuestCpuIdExtMax(PVM pVM);
|
---|
306 | CPUMDECL(uint32_t) CPUMGetGuestCpuIdCentaurMax(PVM pVM);
|
---|
307 | CPUMDECL(CPUMSELREGHID *) CPUMGetGuestTRHid(PVM pVM);
|
---|
308 | /** @} */
|
---|
309 |
|
---|
310 | /** @name Guest Register Setters.
|
---|
311 | * @{ */
|
---|
312 | CPUMDECL(int) CPUMSetGuestGDTR(PVM pVM, uint32_t addr, uint16_t limit);
|
---|
313 | CPUMDECL(int) CPUMSetGuestIDTR(PVM pVM, uint32_t addr, uint16_t limit);
|
---|
314 | CPUMDECL(int) CPUMSetGuestTR(PVM pVM, uint16_t tr);
|
---|
315 | CPUMDECL(int) CPUMSetGuestLDTR(PVM pVM, uint16_t ldtr);
|
---|
316 | CPUMDECL(int) CPUMSetGuestCR0(PVM pVM, uint32_t cr0);
|
---|
317 | CPUMDECL(int) CPUMSetGuestCR2(PVM pVM, uint32_t cr2);
|
---|
318 | CPUMDECL(int) CPUMSetGuestCR3(PVM pVM, uint32_t cr3);
|
---|
319 | CPUMDECL(int) CPUMSetGuestCR4(PVM pVM, uint32_t cr4);
|
---|
320 | CPUMDECL(int) CPUMSetGuestCRx(PVM pVM, uint32_t iReg, uint32_t Value);
|
---|
321 | CPUMDECL(int) CPUMSetGuestDR0(PVM pVM, RTGCUINTREG uDr0);
|
---|
322 | CPUMDECL(int) CPUMSetGuestDR1(PVM pVM, RTGCUINTREG uDr1);
|
---|
323 | CPUMDECL(int) CPUMSetGuestDR2(PVM pVM, RTGCUINTREG uDr2);
|
---|
324 | CPUMDECL(int) CPUMSetGuestDR3(PVM pVM, RTGCUINTREG uDr3);
|
---|
325 | CPUMDECL(int) CPUMSetGuestDR6(PVM pVM, RTGCUINTREG uDr6);
|
---|
326 | CPUMDECL(int) CPUMSetGuestDR7(PVM pVM, RTGCUINTREG uDr7);
|
---|
327 | CPUMDECL(int) CPUMSetGuestDRx(PVM pVM, uint32_t iReg, uint32_t Value);
|
---|
328 | CPUMDECL(int) CPUMSetGuestEFlags(PVM pVM, uint32_t eflags);
|
---|
329 | CPUMDECL(int) CPUMSetGuestEIP(PVM pVM, uint32_t eip);
|
---|
330 | CPUMDECL(int) CPUMSetGuestEAX(PVM pVM, uint32_t eax);
|
---|
331 | CPUMDECL(int) CPUMSetGuestEBX(PVM pVM, uint32_t ebx);
|
---|
332 | CPUMDECL(int) CPUMSetGuestECX(PVM pVM, uint32_t ecx);
|
---|
333 | CPUMDECL(int) CPUMSetGuestEDX(PVM pVM, uint32_t edx);
|
---|
334 | CPUMDECL(int) CPUMSetGuestESI(PVM pVM, uint32_t esi);
|
---|
335 | CPUMDECL(int) CPUMSetGuestEDI(PVM pVM, uint32_t edi);
|
---|
336 | CPUMDECL(int) CPUMSetGuestESP(PVM pVM, uint32_t esp);
|
---|
337 | CPUMDECL(int) CPUMSetGuestEBP(PVM pVM, uint32_t ebp);
|
---|
338 | CPUMDECL(int) CPUMSetGuestCS(PVM pVM, uint16_t cs);
|
---|
339 | CPUMDECL(int) CPUMSetGuestDS(PVM pVM, uint16_t ds);
|
---|
340 | CPUMDECL(int) CPUMSetGuestES(PVM pVM, uint16_t es);
|
---|
341 | CPUMDECL(int) CPUMSetGuestFS(PVM pVM, uint16_t fs);
|
---|
342 | CPUMDECL(int) CPUMSetGuestGS(PVM pVM, uint16_t gs);
|
---|
343 | CPUMDECL(int) CPUMSetGuestSS(PVM pVM, uint16_t ss);
|
---|
344 | CPUMDECL(void) CPUMSetGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
|
---|
345 | CPUMDECL(void) CPUMClearGuestCpuIdFeature(PVM pVM, CPUMCPUIDFEATURE enmFeature);
|
---|
346 | CPUMDECL(void) CPUMSetGuestCtx(PVM pVM, const PCPUMCTX pCtx);
|
---|
347 | /** @} */
|
---|
348 |
|
---|
349 | /** @name Misc Guest Predicate Functions.
|
---|
350 | * @{ */
|
---|
351 |
|
---|
352 | /**
|
---|
353 | * Tests if the guest is running in real mode or not.
|
---|
354 | *
|
---|
355 | * @returns true if in real mode, otherwise false.
|
---|
356 | * @param pVM The VM handle.
|
---|
357 | */
|
---|
358 | DECLINLINE(bool) CPUMIsGuestInRealMode(PVM pVM)
|
---|
359 | {
|
---|
360 | return !(CPUMGetGuestCR0(pVM) & X86_CR0_PE);
|
---|
361 | }
|
---|
362 |
|
---|
363 | /**
|
---|
364 | * Tests if the guest is running in protected or not.
|
---|
365 | *
|
---|
366 | * @returns true if in protected mode, otherwise false.
|
---|
367 | * @param pVM The VM handle.
|
---|
368 | */
|
---|
369 | DECLINLINE(bool) CPUMIsGuestInProtectedMode(PVM pVM)
|
---|
370 | {
|
---|
371 | return !!(CPUMGetGuestCR0(pVM) & X86_CR0_PE);
|
---|
372 | }
|
---|
373 |
|
---|
374 | /**
|
---|
375 | * Tests if the guest is running in paged protected or not.
|
---|
376 | *
|
---|
377 | * @returns true if in paged protected mode, otherwise false.
|
---|
378 | * @param pVM The VM handle.
|
---|
379 | */
|
---|
380 | DECLINLINE(bool) CPUMIsGuestInPagedProtectedMode(PVM pVM)
|
---|
381 | {
|
---|
382 | return (CPUMGetGuestCR0(pVM) & (X86_CR0_PE | X86_CR0_PG)) == (X86_CR0_PE | X86_CR0_PG);
|
---|
383 | }
|
---|
384 |
|
---|
385 | /**
|
---|
386 | * Tests if the guest is running in paged protected or not.
|
---|
387 | *
|
---|
388 | * @returns true if in paged protected mode, otherwise false.
|
---|
389 | * @param pVM The VM handle.
|
---|
390 | */
|
---|
391 | CPUMDECL(bool) CPUMIsGuestIn16BitCode(PVM pVM);
|
---|
392 |
|
---|
393 | /**
|
---|
394 | * Tests if the guest is running in paged protected or not.
|
---|
395 | *
|
---|
396 | * @returns true if in paged protected mode, otherwise false.
|
---|
397 | * @param pVM The VM handle.
|
---|
398 | */
|
---|
399 | CPUMDECL(bool) CPUMIsGuestIn32BitCode(PVM pVM);
|
---|
400 |
|
---|
401 | /**
|
---|
402 | * Tests if the guest is running in paged protected or not.
|
---|
403 | *
|
---|
404 | * @returns true if in paged protected mode, otherwise false.
|
---|
405 | * @param pVM The VM handle.
|
---|
406 | */
|
---|
407 | CPUMDECL(bool) CPUMIsGuestIn64BitCode(PVM pVM);
|
---|
408 |
|
---|
409 | /** @} */
|
---|
410 |
|
---|
411 |
|
---|
412 |
|
---|
413 | /** @name Hypervisor Register Getters.
|
---|
414 | * @{ */
|
---|
415 | CPUMDECL(RTSEL) CPUMGetHyperCS(PVM pVM);
|
---|
416 | CPUMDECL(RTSEL) CPUMGetHyperDS(PVM pVM);
|
---|
417 | CPUMDECL(RTSEL) CPUMGetHyperES(PVM pVM);
|
---|
418 | CPUMDECL(RTSEL) CPUMGetHyperFS(PVM pVM);
|
---|
419 | CPUMDECL(RTSEL) CPUMGetHyperGS(PVM pVM);
|
---|
420 | CPUMDECL(RTSEL) CPUMGetHyperSS(PVM pVM);
|
---|
421 | #if 0 /* these are not correct. */
|
---|
422 | CPUMDECL(uint32_t) CPUMGetHyperCR0(PVM pVM);
|
---|
423 | CPUMDECL(uint32_t) CPUMGetHyperCR2(PVM pVM);
|
---|
424 | CPUMDECL(uint32_t) CPUMGetHyperCR3(PVM pVM);
|
---|
425 | CPUMDECL(uint32_t) CPUMGetHyperCR4(PVM pVM);
|
---|
426 | #endif
|
---|
427 | /** This register is only saved on fatal traps. */
|
---|
428 | CPUMDECL(uint32_t) CPUMGetHyperEAX(PVM pVM);
|
---|
429 | CPUMDECL(uint32_t) CPUMGetHyperEBX(PVM pVM);
|
---|
430 | /** This register is only saved on fatal traps. */
|
---|
431 | CPUMDECL(uint32_t) CPUMGetHyperECX(PVM pVM);
|
---|
432 | /** This register is only saved on fatal traps. */
|
---|
433 | CPUMDECL(uint32_t) CPUMGetHyperEDX(PVM pVM);
|
---|
434 | CPUMDECL(uint32_t) CPUMGetHyperESI(PVM pVM);
|
---|
435 | CPUMDECL(uint32_t) CPUMGetHyperEDI(PVM pVM);
|
---|
436 | CPUMDECL(uint32_t) CPUMGetHyperEBP(PVM pVM);
|
---|
437 | CPUMDECL(uint32_t) CPUMGetHyperESP(PVM pVM);
|
---|
438 | CPUMDECL(uint32_t) CPUMGetHyperEFlags(PVM pVM);
|
---|
439 | CPUMDECL(uint32_t) CPUMGetHyperEIP(PVM pVM);
|
---|
440 | CPUMDECL(uint32_t) CPUMGetHyperIDTR(PVM pVM, uint16_t *pcbLimit);
|
---|
441 | CPUMDECL(uint32_t) CPUMGetHyperGDTR(PVM pVM, uint16_t *pcbLimit);
|
---|
442 | CPUMDECL(RTSEL) CPUMGetHyperLDTR(PVM pVM);
|
---|
443 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR0(PVM pVM);
|
---|
444 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR1(PVM pVM);
|
---|
445 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR2(PVM pVM);
|
---|
446 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR3(PVM pVM);
|
---|
447 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR6(PVM pVM);
|
---|
448 | CPUMDECL(RTGCUINTREG) CPUMGetHyperDR7(PVM pVM);
|
---|
449 | CPUMDECL(void) CPUMGetHyperCtx(PVM pVM, PCPUMCTX pCtx);
|
---|
450 | /** @} */
|
---|
451 |
|
---|
452 | /** @name Hypervisor Register Setters.
|
---|
453 | * @{ */
|
---|
454 | CPUMDECL(void) CPUMSetHyperGDTR(PVM pVM, uint32_t addr, uint16_t limit);
|
---|
455 | CPUMDECL(void) CPUMSetHyperLDTR(PVM pVM, RTSEL SelLDTR);
|
---|
456 | CPUMDECL(void) CPUMSetHyperIDTR(PVM pVM, uint32_t addr, uint16_t limit);
|
---|
457 | CPUMDECL(void) CPUMSetHyperCR3(PVM pVM, uint32_t cr3);
|
---|
458 | CPUMDECL(void) CPUMSetHyperTR(PVM pVM, RTSEL SelTR);
|
---|
459 | CPUMDECL(void) CPUMSetHyperCS(PVM pVM, RTSEL SelCS);
|
---|
460 | CPUMDECL(void) CPUMSetHyperDS(PVM pVM, RTSEL SelDS);
|
---|
461 | CPUMDECL(void) CPUMSetHyperES(PVM pVM, RTSEL SelDS);
|
---|
462 | CPUMDECL(void) CPUMSetHyperFS(PVM pVM, RTSEL SelDS);
|
---|
463 | CPUMDECL(void) CPUMSetHyperGS(PVM pVM, RTSEL SelDS);
|
---|
464 | CPUMDECL(void) CPUMSetHyperSS(PVM pVM, RTSEL SelSS);
|
---|
465 | CPUMDECL(void) CPUMSetHyperESP(PVM pVM, uint32_t u32ESP);
|
---|
466 | CPUMDECL(int) CPUMSetHyperEFlags(PVM pVM, uint32_t Efl);
|
---|
467 | CPUMDECL(void) CPUMSetHyperEIP(PVM pVM, uint32_t u32EIP);
|
---|
468 | CPUMDECL(void) CPUMSetHyperDR0(PVM pVM, RTGCUINTREG uDr0);
|
---|
469 | CPUMDECL(void) CPUMSetHyperDR1(PVM pVM, RTGCUINTREG uDr1);
|
---|
470 | CPUMDECL(void) CPUMSetHyperDR2(PVM pVM, RTGCUINTREG uDr2);
|
---|
471 | CPUMDECL(void) CPUMSetHyperDR3(PVM pVM, RTGCUINTREG uDr3);
|
---|
472 | CPUMDECL(void) CPUMSetHyperDR6(PVM pVM, RTGCUINTREG uDr6);
|
---|
473 | CPUMDECL(void) CPUMSetHyperDR7(PVM pVM, RTGCUINTREG uDr7);
|
---|
474 | CPUMDECL(void) CPUMSetHyperCtx(PVM pVM, const PCPUMCTX pCtx);
|
---|
475 | CPUMDECL(int) CPUMRecalcHyperDRx(PVM pVM);
|
---|
476 | /** @} */
|
---|
477 |
|
---|
478 | CPUMDECL(void) CPUMPushHyper(PVM pVM, uint32_t u32);
|
---|
479 |
|
---|
480 | /**
|
---|
481 | * Sets or resets an alternative hypervisor context core.
|
---|
482 | *
|
---|
483 | * This is called when we get a hypervisor trap set switch the context
|
---|
484 | * core with the trap frame on the stack. It is called again to reset
|
---|
485 | * back to the default context core when resuming hypervisor execution.
|
---|
486 | *
|
---|
487 | * @param pVM The VM handle.
|
---|
488 | * @param pCtxCore Pointer to the alternative context core or NULL
|
---|
489 | * to go back to the default context core.
|
---|
490 | */
|
---|
491 | CPUMDECL(void) CPUMHyperSetCtxCore(PVM pVM, PCPUMCTXCORE pCtxCore);
|
---|
492 |
|
---|
493 |
|
---|
494 | /**
|
---|
495 | * Queries the pointer to the internal CPUMCTX structure
|
---|
496 | *
|
---|
497 | * @returns VBox status code.
|
---|
498 | * @param pVM Handle to the virtual machine.
|
---|
499 | * @param ppCtx Receives the CPUMCTX pointer when successful.
|
---|
500 | */
|
---|
501 | CPUMDECL(int) CPUMQueryGuestCtxPtr(PVM pVM, PCPUMCTX *ppCtx);
|
---|
502 |
|
---|
503 | /**
|
---|
504 | * Queries the pointer to the internal CPUMCTX structure for the hypervisor.
|
---|
505 | *
|
---|
506 | * @returns VBox status code.
|
---|
507 | * @param pVM Handle to the virtual machine.
|
---|
508 | * @param ppCtx Receives the hyper CPUMCTX pointer when successful.
|
---|
509 | */
|
---|
510 | CPUMDECL(int) CPUMQueryHyperCtxPtr(PVM pVM, PCPUMCTX *ppCtx);
|
---|
511 |
|
---|
512 |
|
---|
513 | /**
|
---|
514 | * Gets the pointer to the internal CPUMCTXCORE structure.
|
---|
515 | * This is only for reading in order to save a few calls.
|
---|
516 | *
|
---|
517 | * @param pVM Handle to the virtual machine.
|
---|
518 | */
|
---|
519 | CPUMDECL(PCCPUMCTXCORE) CPUMGetGuestCtxCore(PVM pVM);
|
---|
520 |
|
---|
521 | /**
|
---|
522 | * Gets the pointer to the internal CPUMCTXCORE structure for the hypervisor.
|
---|
523 | * This is only for reading in order to save a few calls.
|
---|
524 | *
|
---|
525 | * @param pVM Handle to the virtual machine.
|
---|
526 | */
|
---|
527 | CPUMDECL(PCCPUMCTXCORE) CPUMGetHyperCtxCore(PVM pVM);
|
---|
528 |
|
---|
529 | /**
|
---|
530 | * Sets the guest context core registers.
|
---|
531 | *
|
---|
532 | * @param pVM Handle to the virtual machine.
|
---|
533 | * @param pCtxCore The new context core values.
|
---|
534 | */
|
---|
535 | CPUMDECL(void) CPUMSetGuestCtxCore(PVM pVM, PCCPUMCTXCORE pCtxCore);
|
---|
536 |
|
---|
537 |
|
---|
538 | /**
|
---|
539 | * Transforms the guest CPU state to raw-ring mode.
|
---|
540 | *
|
---|
541 | * This function will change the any of the cs and ss register with DPL=0 to DPL=1.
|
---|
542 | *
|
---|
543 | * @returns VBox status. (recompiler failure)
|
---|
544 | * @param pVM VM handle.
|
---|
545 | * @param pCtxCore The context core (for trap usage).
|
---|
546 | * @see @ref pg_raw
|
---|
547 | */
|
---|
548 | CPUMDECL(int) CPUMRawEnter(PVM pVM, PCPUMCTXCORE pCtxCore);
|
---|
549 |
|
---|
550 | /**
|
---|
551 | * Transforms the guest CPU state from raw-ring mode to correct values.
|
---|
552 | *
|
---|
553 | * This function will change any selector registers with DPL=1 to DPL=0.
|
---|
554 | *
|
---|
555 | * @returns Adjusted rc.
|
---|
556 | * @param pVM VM handle.
|
---|
557 | * @param rc Raw mode return code
|
---|
558 | * @param pCtxCore The context core (for trap usage).
|
---|
559 | * @see @ref pg_raw
|
---|
560 | */
|
---|
561 | CPUMDECL(int) CPUMRawLeave(PVM pVM, PCPUMCTXCORE pCtxCore, int rc);
|
---|
562 |
|
---|
563 | /**
|
---|
564 | * Gets the EFLAGS while we're in raw-mode.
|
---|
565 | *
|
---|
566 | * @returns The eflags.
|
---|
567 | * @param pVM The VM handle.
|
---|
568 | * @param pCtxCore The context core.
|
---|
569 | */
|
---|
570 | CPUMDECL(uint32_t) CPUMRawGetEFlags(PVM pVM, PCPUMCTXCORE pCtxCore);
|
---|
571 |
|
---|
572 | /**
|
---|
573 | * Updates the EFLAGS while we're in raw-mode.
|
---|
574 | *
|
---|
575 | * @param pVM The VM handle.
|
---|
576 | * @param pCtxCore The context core.
|
---|
577 | * @param eflags The new EFLAGS value.
|
---|
578 | */
|
---|
579 | CPUMDECL(void) CPUMRawSetEFlags(PVM pVM, PCPUMCTXCORE pCtxCore, uint32_t eflags);
|
---|
580 |
|
---|
581 | /**
|
---|
582 | * Lazily sync in the FPU/XMM state
|
---|
583 | *
|
---|
584 | * This function will change any selector registers with DPL=1 to DPL=0.
|
---|
585 | *
|
---|
586 | * @returns VBox status code.
|
---|
587 | * @param pVM VM handle.
|
---|
588 | */
|
---|
589 | CPUMDECL(int) CPUMHandleLazyFPU(PVM pVM);
|
---|
590 |
|
---|
591 |
|
---|
592 | /**
|
---|
593 | * Restore host FPU/XMM state
|
---|
594 | *
|
---|
595 | * @returns VBox status code.
|
---|
596 | * @param pVM VM handle.
|
---|
597 | */
|
---|
598 | CPUMDECL(int) CPUMRestoreHostFPUState(PVM pVM);
|
---|
599 |
|
---|
600 | /** @name Changed flags
|
---|
601 | * These flags are used to keep track of which important register that
|
---|
602 | * have been changed since last they were reset. The only one allowed
|
---|
603 | * to clear them is REM!
|
---|
604 | * @{
|
---|
605 | */
|
---|
606 | #define CPUM_CHANGED_FPU_REM RT_BIT(0)
|
---|
607 | #define CPUM_CHANGED_CR0 RT_BIT(1)
|
---|
608 | #define CPUM_CHANGED_CR4 RT_BIT(2)
|
---|
609 | #define CPUM_CHANGED_GLOBAL_TLB_FLUSH RT_BIT(3)
|
---|
610 | #define CPUM_CHANGED_CR3 RT_BIT(4)
|
---|
611 | #define CPUM_CHANGED_GDTR RT_BIT(5)
|
---|
612 | #define CPUM_CHANGED_IDTR RT_BIT(6)
|
---|
613 | #define CPUM_CHANGED_LDTR RT_BIT(7)
|
---|
614 | #define CPUM_CHANGED_TR RT_BIT(8)
|
---|
615 | #define CPUM_CHANGED_SYSENTER_MSR RT_BIT(9)
|
---|
616 | #define CPUM_CHANGED_HIDDEN_SEL_REGS RT_BIT(10)
|
---|
617 | /** @} */
|
---|
618 |
|
---|
619 | /**
|
---|
620 | * Gets and resets the changed flags (CPUM_CHANGED_*).
|
---|
621 | *
|
---|
622 | * @returns The changed flags.
|
---|
623 | * @param pVM VM handle.
|
---|
624 | */
|
---|
625 | CPUMDECL(unsigned) CPUMGetAndClearChangedFlagsREM(PVM pVM);
|
---|
626 |
|
---|
627 | /**
|
---|
628 | * Sets the specified changed flags (CPUM_CHANGED_*).
|
---|
629 | *
|
---|
630 | * @param pVM The VM handle.
|
---|
631 | */
|
---|
632 | CPUMDECL(void) CPUMSetChangedFlags(PVM pVM, uint32_t fChangedFlags);
|
---|
633 |
|
---|
634 | /**
|
---|
635 | * Checks if the CPU supports the FXSAVE and FXRSTOR instruction.
|
---|
636 | * @returns true if supported.
|
---|
637 | * @returns false if not supported.
|
---|
638 | * @param pVM The VM handle.
|
---|
639 | */
|
---|
640 | CPUMDECL(bool) CPUMSupportsFXSR(PVM pVM);
|
---|
641 |
|
---|
642 | /**
|
---|
643 | * Checks if the host OS uses the SYSENTER / SYSEXIT instructions.
|
---|
644 | * @returns true if used.
|
---|
645 | * @returns false if not used.
|
---|
646 | * @param pVM The VM handle.
|
---|
647 | */
|
---|
648 | CPUMDECL(bool) CPUMIsHostUsingSysEnter(PVM pVM);
|
---|
649 |
|
---|
650 | /**
|
---|
651 | * Checks if the host OS uses the SYSCALL / SYSRET instructions.
|
---|
652 | * @returns true if used.
|
---|
653 | * @returns false if not used.
|
---|
654 | * @param pVM The VM handle.
|
---|
655 | */
|
---|
656 | CPUMDECL(bool) CPUMIsHostUsingSysCall(PVM pVM);
|
---|
657 |
|
---|
658 | /**
|
---|
659 | * Checks if we activated the FPU/XMM state of the guest OS
|
---|
660 | * @returns true if we did.
|
---|
661 | * @returns false if not.
|
---|
662 | * @param pVM The VM handle.
|
---|
663 | */
|
---|
664 | CPUMDECL(bool) CPUMIsGuestFPUStateActive(PVM pVM);
|
---|
665 |
|
---|
666 | /**
|
---|
667 | * Deactivate the FPU/XMM state of the guest OS
|
---|
668 | * @param pVM The VM handle.
|
---|
669 | */
|
---|
670 | CPUMDECL(void) CPUMDeactivateGuestFPUState(PVM pVM);
|
---|
671 |
|
---|
672 |
|
---|
673 | /**
|
---|
674 | * Checks if the hidden selector registers are valid
|
---|
675 | * @returns true if they are.
|
---|
676 | * @returns false if not.
|
---|
677 | * @param pVM The VM handle.
|
---|
678 | */
|
---|
679 | CPUMDECL(bool) CPUMAreHiddenSelRegsValid(PVM pVM);
|
---|
680 |
|
---|
681 | /**
|
---|
682 | * Checks if the hidden selector registers are valid
|
---|
683 | * @param pVM The VM handle.
|
---|
684 | * @param fValid Valid or not
|
---|
685 | */
|
---|
686 | CPUMDECL(void) CPUMSetHiddenSelRegsValid(PVM pVM, bool fValid);
|
---|
687 |
|
---|
688 | /**
|
---|
689 | * Get the current privilege level of the guest.
|
---|
690 | *
|
---|
691 | * @returns cpl
|
---|
692 | * @param pVM VM Handle.
|
---|
693 | * @param pRegFrame Trap register frame.
|
---|
694 | */
|
---|
695 | CPUMDECL(uint32_t) CPUMGetGuestCPL(PVM pVM, PCPUMCTXCORE pCtxCore);
|
---|
696 |
|
---|
697 | /**
|
---|
698 | * CPU modes.
|
---|
699 | */
|
---|
700 | typedef enum CPUMMODE
|
---|
701 | {
|
---|
702 | /** The usual invalid zero entry. */
|
---|
703 | CPUMMODE_INVALID = 0,
|
---|
704 | /** Real mode. */
|
---|
705 | CPUMMODE_REAL,
|
---|
706 | /** Protected mode (32-bit). */
|
---|
707 | CPUMMODE_PROTECTED,
|
---|
708 | /** Long mode (64-bit). */
|
---|
709 | CPUMMODE_LONG
|
---|
710 | } CPUMMODE;
|
---|
711 |
|
---|
712 | /**
|
---|
713 | * Gets the current guest CPU mode.
|
---|
714 | *
|
---|
715 | * If paging mode is what you need, check out PGMGetGuestMode().
|
---|
716 | *
|
---|
717 | * @returns The CPU mode.
|
---|
718 | * @param pVM The VM handle.
|
---|
719 | */
|
---|
720 | CPUMDECL(CPUMMODE) CPUMGetGuestMode(PVM pVM);
|
---|
721 |
|
---|
722 |
|
---|
723 | #ifdef IN_RING3
|
---|
724 | /** @defgroup grp_cpum_r3 The CPU Monitor(/Manager) API
|
---|
725 | * @ingroup grp_cpum
|
---|
726 | * @{
|
---|
727 | */
|
---|
728 |
|
---|
729 | /**
|
---|
730 | * Initializes the CPUM.
|
---|
731 | *
|
---|
732 | * @returns VBox status code.
|
---|
733 | * @param pVM The VM to operate on.
|
---|
734 | */
|
---|
735 | CPUMR3DECL(int) CPUMR3Init(PVM pVM);
|
---|
736 |
|
---|
737 | /**
|
---|
738 | * Applies relocations to data and code managed by this
|
---|
739 | * component. This function will be called at init and
|
---|
740 | * whenever the VMM need to relocate it self inside the GC.
|
---|
741 | *
|
---|
742 | * The CPUM will update the addresses used by the switcher.
|
---|
743 | *
|
---|
744 | * @param pVM The VM.
|
---|
745 | */
|
---|
746 | CPUMR3DECL(void) CPUMR3Relocate(PVM pVM);
|
---|
747 |
|
---|
748 | /**
|
---|
749 | * Terminates the CPUM.
|
---|
750 | *
|
---|
751 | * Termination means cleaning up and freeing all resources,
|
---|
752 | * the VM it self is at this point powered off or suspended.
|
---|
753 | *
|
---|
754 | * @returns VBox status code.
|
---|
755 | * @param pVM The VM to operate on.
|
---|
756 | */
|
---|
757 | CPUMR3DECL(int) CPUMR3Term(PVM pVM);
|
---|
758 |
|
---|
759 | /**
|
---|
760 | * Resets the CPU.
|
---|
761 | *
|
---|
762 | * @param pVM The VM handle.
|
---|
763 | */
|
---|
764 | CPUMR3DECL(void) CPUMR3Reset(PVM pVM);
|
---|
765 |
|
---|
766 | /**
|
---|
767 | * Queries the pointer to the internal CPUMCTX structure
|
---|
768 | *
|
---|
769 | * @returns VBox status code.
|
---|
770 | * @param pVM Handle to the virtual machine.
|
---|
771 | * @param ppCtx Receives the CPUMCTX GC pointer when successful.
|
---|
772 | */
|
---|
773 | CPUMR3DECL(int) CPUMR3QueryGuestCtxGCPtr(PVM pVM, GCPTRTYPE(PCPUMCTX) *ppCtx);
|
---|
774 |
|
---|
775 |
|
---|
776 | #ifdef DEBUG
|
---|
777 | /**
|
---|
778 | * Debug helper - Saves guest context on raw mode entry (for fatal dump)
|
---|
779 | *
|
---|
780 | * @internal
|
---|
781 | */
|
---|
782 | CPUMR3DECL(void) CPUMR3SaveEntryCtx(PVM pVM);
|
---|
783 | #endif
|
---|
784 |
|
---|
785 | /**
|
---|
786 | * API for controlling a few of the CPU features found in CR4.
|
---|
787 | *
|
---|
788 | * Currently only X86_CR4_TSD is accepted as input.
|
---|
789 | *
|
---|
790 | * @returns VBox status code.
|
---|
791 | *
|
---|
792 | * @param pVM The VM handle.
|
---|
793 | * @param fOr The CR4 OR mask.
|
---|
794 | * @param fAnd The CR4 AND mask.
|
---|
795 | */
|
---|
796 | CPUMR3DECL(int) CPUMR3SetCR4Feature(PVM pVM, RTHCUINTREG fOr, RTHCUINTREG fAnd);
|
---|
797 |
|
---|
798 | /** @} */
|
---|
799 | #endif
|
---|
800 |
|
---|
801 | #ifdef IN_GC
|
---|
802 | /** @defgroup grp_cpum_gc The CPU Monitor(/Manager) API
|
---|
803 | * @ingroup grp_cpum
|
---|
804 | * @{
|
---|
805 | */
|
---|
806 |
|
---|
807 | /**
|
---|
808 | * Calls a guest trap/interrupt handler directly
|
---|
809 | * Assumes a trap stack frame has already been setup on the guest's stack!
|
---|
810 | *
|
---|
811 | * @param pRegFrame Original trap/interrupt context
|
---|
812 | * @param selCS Code selector of handler
|
---|
813 | * @param pHandler GC virtual address of handler
|
---|
814 | * @param eflags Callee's EFLAGS
|
---|
815 | * @param selSS Stack selector for handler
|
---|
816 | * @param pEsp Stack address for handler
|
---|
817 | *
|
---|
818 | * This function does not return!
|
---|
819 | *
|
---|
820 | */
|
---|
821 | CPUMGCDECL(void) CPUMGCCallGuestTrapHandler(PCPUMCTXCORE pRegFrame, uint32_t selCS, RTGCPTR pHandler, uint32_t eflags, uint32_t selSS, RTGCPTR pEsp);
|
---|
822 |
|
---|
823 | /**
|
---|
824 | * Performs an iret to V86 code
|
---|
825 | * Assumes a trap stack frame has already been setup on the guest's stack!
|
---|
826 | *
|
---|
827 | * @param pRegFrame Original trap/interrupt context
|
---|
828 | *
|
---|
829 | * This function does not return!
|
---|
830 | */
|
---|
831 | CPUMGCDECL(void) CPUMGCCallV86Code(PCPUMCTXCORE pRegFrame);
|
---|
832 |
|
---|
833 | /** @} */
|
---|
834 | #endif
|
---|
835 |
|
---|
836 | #ifdef IN_RING0
|
---|
837 | /** @defgroup grp_cpum_r0 The CPU Monitor(/Manager) API
|
---|
838 | * @ingroup grp_cpum
|
---|
839 | * @{
|
---|
840 | */
|
---|
841 |
|
---|
842 | /**
|
---|
843 | * Does Ring-0 CPUM initialization.
|
---|
844 | *
|
---|
845 | * This is mainly to check that the Host CPU mode is compatible
|
---|
846 | * with VBox.
|
---|
847 | *
|
---|
848 | * @returns VBox status code.
|
---|
849 | * @param pVM The VM to operate on.
|
---|
850 | */
|
---|
851 | CPUMR0DECL(int) CPUMR0Init(PVM pVM);
|
---|
852 |
|
---|
853 | /** @} */
|
---|
854 | #endif
|
---|
855 |
|
---|
856 | /** @} */
|
---|
857 | __END_DECLS
|
---|
858 |
|
---|
859 |
|
---|
860 | #endif
|
---|
861 |
|
---|
862 |
|
---|
863 |
|
---|
864 |
|
---|
865 |
|
---|