VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp@ 58251

Last change on this file since 58251 was 58126, checked in by vboxsync, 9 years ago

VMM: Fixed almost all the Doxygen warnings.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.5 KB
Line 
1/* $Id: GIMKvm.cpp 58126 2015-10-08 20:59:48Z vboxsync $ */
2/** @file
3 * GIM - Guest Interface Manager, KVM implementation.
4 */
5
6/*
7 * Copyright (C) 2015 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define LOG_GROUP LOG_GROUP_GIM
23#include "GIMInternal.h"
24
25#include <iprt/asm-math.h>
26#include <iprt/assert.h>
27#include <iprt/err.h>
28#include <iprt/string.h>
29#include <iprt/mem.h>
30#include <iprt/spinlock.h>
31
32#include <VBox/vmm/cpum.h>
33#include <VBox/disopcode.h>
34#include <VBox/vmm/ssm.h>
35#include <VBox/vmm/vm.h>
36#include <VBox/vmm/hm.h>
37#include <VBox/vmm/pdmapi.h>
38#include <VBox/version.h>
39
40
41/*********************************************************************************************************************************
42* Defined Constants And Macros *
43*********************************************************************************************************************************/
44
45/**
46 * GIM KVM saved-state version.
47 */
48#define GIM_KVM_SAVED_STATE_VERSION UINT32_C(1)
49
50/**
51 * VBox internal struct. to passback to EMT rendezvous callback while enabling
52 * the KVM wall-clock.
53 */
54typedef struct KVMWALLCLOCKINFO
55{
56 /** Guest physical address of the wall-clock struct. */
57 RTGCPHYS GCPhysWallClock;
58} KVMWALLCLOCKINFO;
59/** Pointer to the wall-clock info. struct. */
60typedef KVMWALLCLOCKINFO *PKVMWALLCLOCKINFO;
61
62
63/*********************************************************************************************************************************
64* Global Variables *
65*********************************************************************************************************************************/
66#ifdef VBOX_WITH_STATISTICS
67# define GIMKVM_MSRRANGE(a_uFirst, a_uLast, a_szName) \
68 { (a_uFirst), (a_uLast), kCpumMsrRdFn_Gim, kCpumMsrWrFn_Gim, 0, 0, 0, 0, 0, a_szName, { 0 }, { 0 }, { 0 }, { 0 } }
69#else
70# define GIMKVM_MSRRANGE(a_uFirst, a_uLast, a_szName) \
71 { (a_uFirst), (a_uLast), kCpumMsrRdFn_Gim, kCpumMsrWrFn_Gim, 0, 0, 0, 0, 0, a_szName }
72#endif
73
74/**
75 * Array of MSR ranges supported by KVM.
76 */
77static CPUMMSRRANGE const g_aMsrRanges_Kvm[] =
78{
79 GIMKVM_MSRRANGE(MSR_GIM_KVM_RANGE0_START, MSR_GIM_KVM_RANGE0_END, "KVM range 0"),
80 GIMKVM_MSRRANGE(MSR_GIM_KVM_RANGE1_START, MSR_GIM_KVM_RANGE1_END, "KVM range 1")
81};
82#undef GIMKVM_MSRRANGE
83
84
85/**
86 * Initializes the KVM GIM provider.
87 *
88 * @returns VBox status code.
89 * @param pVM The cross context VM structure.
90 */
91VMMR3_INT_DECL(int) gimR3KvmInit(PVM pVM)
92{
93 AssertReturn(pVM, VERR_INVALID_PARAMETER);
94 AssertReturn(pVM->gim.s.enmProviderId == GIMPROVIDERID_KVM, VERR_INTERNAL_ERROR_5);
95
96 int rc;
97 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
98
99 /*
100 * Determine interface capabilities based on the version.
101 */
102 if (!pVM->gim.s.u32Version)
103 {
104 /* Basic features. */
105 pKvm->uBaseFeat = 0
106 | GIM_KVM_BASE_FEAT_CLOCK_OLD
107 //| GIM_KVM_BASE_FEAT_NOP_IO_DELAY
108 //| GIM_KVM_BASE_FEAT_MMU_OP
109 | GIM_KVM_BASE_FEAT_CLOCK
110 //| GIM_KVM_BASE_FEAT_ASYNC_PF
111 //| GIM_KVM_BASE_FEAT_STEAL_TIME
112 //| GIM_KVM_BASE_FEAT_PV_EOI
113 | GIM_KVM_BASE_FEAT_PV_UNHALT
114 ;
115 /* Rest of the features are determined in gimR3KvmInitCompleted(). */
116 }
117
118 /*
119 * Expose HVP (Hypervisor Present) bit to the guest.
120 */
121 CPUMSetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_HVP);
122
123 /*
124 * Modify the standard hypervisor leaves for KVM.
125 */
126 CPUMCPUIDLEAF HyperLeaf;
127 RT_ZERO(HyperLeaf);
128 HyperLeaf.uLeaf = UINT32_C(0x40000000);
129 HyperLeaf.uEax = UINT32_C(0x40000001); /* Minimum value for KVM is 0x40000001. */
130 HyperLeaf.uEbx = 0x4B4D564B; /* 'KVMK' */
131 HyperLeaf.uEcx = 0x564B4D56; /* 'VMKV' */
132 HyperLeaf.uEdx = 0x0000004D; /* 'M000' */
133 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
134 AssertLogRelRCReturn(rc, rc);
135
136 /*
137 * Add KVM specific leaves.
138 */
139 HyperLeaf.uLeaf = UINT32_C(0x40000001);
140 HyperLeaf.uEax = pKvm->uBaseFeat;
141 HyperLeaf.uEbx = 0; /* Reserved */
142 HyperLeaf.uEcx = 0; /* Reserved */
143 HyperLeaf.uEdx = 0; /* Reserved */
144 rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
145 AssertLogRelRCReturn(rc, rc);
146
147 /*
148 * Insert all MSR ranges of KVM.
149 */
150 for (unsigned i = 0; i < RT_ELEMENTS(g_aMsrRanges_Kvm); i++)
151 {
152 rc = CPUMR3MsrRangesInsert(pVM, &g_aMsrRanges_Kvm[i]);
153 AssertLogRelRCReturn(rc, rc);
154 }
155
156 /*
157 * Setup hypercall and #UD handling.
158 */
159 for (VMCPUID i = 0; i < pVM->cCpus; i++)
160 VMMHypercallsEnable(&pVM->aCpus[i]);
161
162 if (ASMIsAmdCpu())
163 {
164 pKvm->fTrapXcptUD = true;
165 pKvm->uOpCodeNative = OP_VMMCALL;
166 }
167 else
168 {
169 Assert(ASMIsIntelCpu() || ASMIsViaCentaurCpu());
170 pKvm->fTrapXcptUD = false;
171 pKvm->uOpCodeNative = OP_VMCALL;
172 }
173
174 /* We always need to trap VMCALL/VMMCALL hypercall using #UDs for raw-mode VMs. */
175 if (!HMIsEnabled(pVM))
176 pKvm->fTrapXcptUD = true;
177
178 return VINF_SUCCESS;
179}
180
181
182/**
183 * Initializes remaining bits of the KVM provider.
184 *
185 * This is called after initializing HM and almost all other VMM components.
186 *
187 * @returns VBox status code.
188 * @param pVM The cross context VM structure.
189 */
190VMMR3_INT_DECL(int) gimR3KvmInitCompleted(PVM pVM)
191{
192 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
193 pKvm->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
194
195 if (TMR3CpuTickIsFixedRateMonotonic(pVM, true /* fWithParavirtEnabled */))
196 {
197 /** @todo We might want to consider just enabling this bit *always*. As far
198 * as I can see in the Linux guest, the "TSC_STABLE" bit is only
199 * translated as a "monotonic" bit which even in Async systems we
200 * -should- be reporting a strictly monotonic TSC to the guest. */
201 pKvm->uBaseFeat |= GIM_KVM_BASE_FEAT_TSC_STABLE;
202
203 CPUMCPUIDLEAF HyperLeaf;
204 RT_ZERO(HyperLeaf);
205 HyperLeaf.uLeaf = UINT32_C(0x40000001);
206 HyperLeaf.uEax = pKvm->uBaseFeat;
207 HyperLeaf.uEbx = 0;
208 HyperLeaf.uEcx = 0;
209 HyperLeaf.uEdx = 0;
210 int rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
211 AssertLogRelRCReturn(rc, rc);
212 }
213 return VINF_SUCCESS;
214}
215
216
217/**
218 * Terminates the KVM GIM provider.
219 *
220 * @returns VBox status code.
221 * @param pVM The cross context VM structure.
222 */
223VMMR3_INT_DECL(int) gimR3KvmTerm(PVM pVM)
224{
225 gimR3KvmReset(pVM);
226 return VINF_SUCCESS;
227}
228
229
230/**
231 * Applies relocations to data and code managed by this component.
232 *
233 * This function will be called at init and whenever the VMM need to relocate
234 * itself inside the GC.
235 *
236 * @param pVM The cross context VM structure.
237 * @param offDelta Relocation delta relative to old location.
238 */
239VMMR3_INT_DECL(void) gimR3KvmRelocate(PVM pVM, RTGCINTPTR offDelta)
240{
241 NOREF(pVM); NOREF(offDelta);
242}
243
244
245/**
246 * This resets KVM provider MSRs and unmaps whatever KVM regions that
247 * the guest may have mapped.
248 *
249 * This is called when the VM is being reset.
250 *
251 * @param pVM The cross context VM structure.
252 * @thread EMT(0).
253 */
254VMMR3_INT_DECL(void) gimR3KvmReset(PVM pVM)
255{
256 VM_ASSERT_EMT0(pVM);
257 LogRel(("GIM: KVM: Resetting MSRs\n"));
258
259 /*
260 * Reset MSRs.
261 */
262 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
263 pKvm->u64WallClockMsr = 0;
264 for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++)
265 {
266 PGIMKVMCPU pKvmCpu = &pVM->aCpus[iCpu].gim.s.u.KvmCpu;
267 pKvmCpu->u64SystemTimeMsr = 0;
268 pKvmCpu->u32SystemTimeVersion = 0;
269 pKvmCpu->fSystemTimeFlags = 0;
270 pKvmCpu->GCPhysSystemTime = 0;
271 pKvmCpu->uTsc = 0;
272 pKvmCpu->uVirtNanoTS = 0;
273 }
274}
275
276
277/**
278 * KVM state-save operation.
279 *
280 * @returns VBox status code.
281 * @param pVM The cross context VM structure.
282 * @param pSSM Pointer to the SSM handle.
283 */
284VMMR3_INT_DECL(int) gimR3KvmSave(PVM pVM, PSSMHANDLE pSSM)
285{
286 PCGIMKVM pcKvm = &pVM->gim.s.u.Kvm;
287
288 /*
289 * Save the KVM SSM version.
290 */
291 SSMR3PutU32(pSSM, GIM_KVM_SAVED_STATE_VERSION);
292
293 /*
294 * Save per-VCPU data.
295 */
296 for (uint32_t i = 0; i < pVM->cCpus; i++)
297 {
298 PCGIMKVMCPU pcKvmCpu = &pVM->aCpus[i].gim.s.u.KvmCpu;
299
300 /* Guest may alter flags (namely GIM_KVM_SYSTEM_TIME_FLAGS_GUEST_PAUSED bit). So re-read them from guest-memory. */
301 GIMKVMSYSTEMTIME SystemTime;
302 RT_ZERO(SystemTime);
303 if (MSR_GIM_KVM_SYSTEM_TIME_IS_ENABLED(pcKvmCpu->u64SystemTimeMsr))
304 {
305 int rc = PGMPhysSimpleReadGCPhys(pVM, &SystemTime, pcKvmCpu->GCPhysSystemTime, sizeof(GIMKVMSYSTEMTIME));
306 AssertRCReturn(rc, rc);
307 }
308
309 SSMR3PutU64(pSSM, pcKvmCpu->u64SystemTimeMsr);
310 SSMR3PutU64(pSSM, pcKvmCpu->uTsc);
311 SSMR3PutU64(pSSM, pcKvmCpu->uVirtNanoTS);
312 SSMR3PutGCPhys(pSSM, pcKvmCpu->GCPhysSystemTime);
313 SSMR3PutU32(pSSM, pcKvmCpu->u32SystemTimeVersion);
314 SSMR3PutU8(pSSM, SystemTime.fFlags);
315 }
316
317 /*
318 * Save per-VM data.
319 */
320 SSMR3PutU64(pSSM, pcKvm->u64WallClockMsr);
321 return SSMR3PutU32(pSSM, pcKvm->uBaseFeat);
322}
323
324
325/**
326 * KVM state-load operation, final pass.
327 *
328 * @returns VBox status code.
329 * @param pVM The cross context VM structure.
330 * @param pSSM Pointer to the SSM handle.
331 * @param uSSMVersion The GIM saved-state version.
332 */
333VMMR3_INT_DECL(int) gimR3KvmLoad(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion)
334{
335 /*
336 * Load the KVM SSM version first.
337 */
338 uint32_t uKvmSavedStatVersion;
339 int rc = SSMR3GetU32(pSSM, &uKvmSavedStatVersion);
340 AssertRCReturn(rc, rc);
341 if (uKvmSavedStatVersion != GIM_KVM_SAVED_STATE_VERSION)
342 return SSMR3SetLoadError(pSSM, VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION, RT_SRC_POS,
343 N_("Unsupported KVM saved-state version %u (expected %u)."), uKvmSavedStatVersion,
344 GIM_KVM_SAVED_STATE_VERSION);
345
346 /*
347 * Update the TSC frequency from TM.
348 */
349 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
350 pKvm->cTscTicksPerSecond = TMCpuTicksPerSecond(pVM);
351
352 /*
353 * Load per-VCPU data.
354 */
355 for (uint32_t i = 0; i < pVM->cCpus; i++)
356 {
357 PVMCPU pVCpu = &pVM->aCpus[i];
358 PGIMKVMCPU pKvmCpu = &pVCpu->gim.s.u.KvmCpu;
359
360 uint8_t fSystemTimeFlags = 0;
361 SSMR3GetU64(pSSM, &pKvmCpu->u64SystemTimeMsr);
362 SSMR3GetU64(pSSM, &pKvmCpu->uTsc);
363 SSMR3GetU64(pSSM, &pKvmCpu->uVirtNanoTS);
364 SSMR3GetGCPhys(pSSM, &pKvmCpu->GCPhysSystemTime);
365 SSMR3GetU32(pSSM, &pKvmCpu->u32SystemTimeVersion);
366 rc = SSMR3GetU8(pSSM, &pKvmCpu->fSystemTimeFlags);
367 AssertRCReturn(rc, rc);
368
369 /* Enable the system-time struct. if necessary. */
370 /** @todo update guest struct only if cTscTicksPerSecond doesn't match host
371 * anymore. */
372 if (MSR_GIM_KVM_SYSTEM_TIME_IS_ENABLED(pKvmCpu->u64SystemTimeMsr))
373 {
374 Assert(!TMVirtualIsTicking(pVM)); /* paranoia. */
375 Assert(!TMCpuTickIsTicking(pVCpu));
376 rc = gimR3KvmEnableSystemTime(pVM, pVCpu);
377 AssertRCReturn(rc, rc);
378 }
379 }
380
381 /*
382 * Load per-VM data.
383 */
384 SSMR3GetU64(pSSM, &pKvm->u64WallClockMsr);
385 rc = SSMR3GetU32(pSSM, &pKvm->uBaseFeat);
386 AssertRCReturn(rc, rc);
387
388 return VINF_SUCCESS;
389}
390
391
392/**
393 * Enables the KVM VCPU system-time structure.
394 *
395 * @returns VBox status code.
396 * @param pVM The cross context VM structure.
397 * @param pVCpu The cross context virtual CPU structure.
398 *
399 * @remarks Don't do any release assertions here, these can be triggered by
400 * guest R0 code.
401 */
402VMMR3_INT_DECL(int) gimR3KvmEnableSystemTime(PVM pVM, PVMCPU pVCpu)
403{
404 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;
405 PGIMKVMCPU pKvmCpu = &pVCpu->gim.s.u.KvmCpu;
406
407 /*
408 * Validate the mapping address first.
409 */
410 if (!PGMPhysIsGCPhysNormal(pVM, pKvmCpu->GCPhysSystemTime))
411 {
412 LogRel(("GIM: KVM: VCPU%3d: Invalid physical addr requested for mapping system-time struct. GCPhysSystemTime=%#RGp\n",
413 pVCpu->idCpu, pKvmCpu->GCPhysSystemTime));
414 return VERR_GIM_OPERATION_FAILED;
415 }
416
417 /*
418 * Construct the system-time struct.
419 */
420 GIMKVMSYSTEMTIME SystemTime;
421 RT_ZERO(SystemTime);
422 SystemTime.u32Version = pKvmCpu->u32SystemTimeVersion;
423 SystemTime.u64NanoTS = pKvmCpu->uVirtNanoTS;
424 SystemTime.u64Tsc = pKvmCpu->uTsc;
425 SystemTime.fFlags = pKvmCpu->fSystemTimeFlags | GIM_KVM_SYSTEM_TIME_FLAGS_TSC_STABLE;
426
427 /*
428 * How the guest calculates the system time (nanoseconds):
429 *
430 * tsc = rdtsc - SysTime.u64Tsc
431 * if (SysTime.i8TscShift >= 0)
432 * tsc <<= i8TscShift;
433 * else
434 * tsc >>= -i8TscShift;
435 * time = ((tsc * SysTime.u32TscScale) >> 32) + SysTime.u64NanoTS
436 */
437 uint64_t u64TscFreq = pKvm->cTscTicksPerSecond;
438 SystemTime.i8TscShift = 0;
439 while (u64TscFreq > 2 * RT_NS_1SEC_64)
440 {
441 u64TscFreq >>= 1;
442 SystemTime.i8TscShift--;
443 }
444 uint32_t uTscFreqLo = (uint32_t)u64TscFreq;
445 while (uTscFreqLo <= RT_NS_1SEC)
446 {
447 uTscFreqLo <<= 1;
448 SystemTime.i8TscShift++;
449 }
450 SystemTime.u32TscScale = ASMDivU64ByU32RetU32(RT_NS_1SEC_64 << 32, uTscFreqLo);
451
452 /*
453 * Update guest memory with the system-time struct.
454 */
455 Assert(!(SystemTime.u32Version & UINT32_C(1)));
456 int rc = PGMPhysSimpleWriteGCPhys(pVM, pKvmCpu->GCPhysSystemTime, &SystemTime, sizeof(GIMKVMSYSTEMTIME));
457 if (RT_SUCCESS(rc))
458 {
459 LogRel(("GIM: KVM: VCPU%3d: Enabled system-time struct. at %#RGp - u32TscScale=%#RX32 i8TscShift=%d uVersion=%#RU32 "
460 "fFlags=%#x uTsc=%#RX64 uVirtNanoTS=%#RX64\n", pVCpu->idCpu, pKvmCpu->GCPhysSystemTime, SystemTime.u32TscScale,
461 SystemTime.i8TscShift, SystemTime.u32Version, SystemTime.fFlags, pKvmCpu->uTsc, pKvmCpu->uVirtNanoTS));
462 TMR3CpuTickParavirtEnable(pVM);
463 }
464 else
465 LogRel(("GIM: KVM: VCPU%3d: Failed to write system-time struct. at %#RGp. rc=%Rrc\n",
466 pVCpu->idCpu, pKvmCpu->GCPhysSystemTime, rc));
467
468 return rc;
469}
470
471
472/**
473 * Disables the KVM system-time struct.
474 *
475 * @returns VBox status code.
476 * @param pVM The cross context VM structure.
477 */
478VMMR3_INT_DECL(int) gimR3KvmDisableSystemTime(PVM pVM)
479{
480 TMR3CpuTickParavirtDisable(pVM);
481 return VINF_SUCCESS;
482}
483
484
485/**
486 * @callback_method_impl{PFNVMMEMTRENDEZVOUS,
487 * Worker for gimR3KvmEnableWallClock}
488 */
489static DECLCALLBACK(VBOXSTRICTRC) gimR3KvmEnableWallClockCallback(PVM pVM, PVMCPU pVCpu, void *pvData)
490{
491 Assert(pvData);
492 PKVMWALLCLOCKINFO pWallClockInfo = (PKVMWALLCLOCKINFO)pvData;
493 RTGCPHYS GCPhysWallClock = pWallClockInfo->GCPhysWallClock;
494
495 /*
496 * Read the wall-clock version (sequence) from the guest.
497 */
498 uint32_t uVersion;
499 Assert(PGMPhysIsGCPhysNormal(pVM, GCPhysWallClock));
500 int rc = PGMPhysSimpleReadGCPhys(pVM, &uVersion, GCPhysWallClock, sizeof(uVersion));
501 if (RT_FAILURE(rc))
502 {
503 LogRel(("GIM: KVM: Failed to read wall-clock struct. version at %#RGp. rc=%Rrc\n", GCPhysWallClock, rc));
504 return rc;
505 }
506
507 /*
508 * Ensure the version is incrementally even.
509 */
510 if (!(uVersion & 1))
511 ++uVersion;
512 ++uVersion;
513
514 /*
515 * Update wall-clock guest struct. with UTC information.
516 */
517 RTTIMESPEC TimeSpec;
518 int32_t iSec;
519 int32_t iNano;
520 TMR3UtcNow(pVM, &TimeSpec);
521 RTTimeSpecGetSecondsAndNano(&TimeSpec, &iSec, &iNano);
522
523 GIMKVMWALLCLOCK WallClock;
524 RT_ZERO(WallClock);
525 AssertCompile(sizeof(uVersion) == sizeof(WallClock.u32Version));
526 WallClock.u32Version = uVersion;
527 WallClock.u32Sec = iSec;
528 WallClock.u32Nano = iNano;
529
530 /*
531 * Write out the wall-clock struct. to guest memory.
532 */
533 Assert(!(WallClock.u32Version & 1));
534 rc = PGMPhysSimpleWriteGCPhys(pVM, GCPhysWallClock, &WallClock, sizeof(GIMKVMWALLCLOCK));
535 if (RT_SUCCESS(rc))
536 {
537 LogRel(("GIM: KVM: Enabled wall-clock struct. at %#RGp - u32Sec=%u u32Nano=%u uVersion=%#RU32\n", GCPhysWallClock,
538 WallClock.u32Sec, WallClock.u32Nano, WallClock.u32Version));
539 }
540 else
541 LogRel(("GIM: KVM: Failed to write wall-clock struct. at %#RGp. rc=%Rrc\n", GCPhysWallClock, rc));
542 return rc;
543}
544
545
546/**
547 * Enables the KVM wall-clock structure.
548 *
549 * Since the wall-clock can be read by any VCPU but it is a global struct. in
550 * guest-memory, we do an EMT rendezvous here to be on the safe side. The
551 * alternative is to use an MMIO2 region and use the WallClock.u32Version field
552 * for transactional update. However, this MSR is rarely written to (typically
553 * once during bootup) it's currently not a performance issue especially since
554 * we're already in ring-3. If we really wanted better performance in this code
555 * path, we should be doing it in ring-0 with transactional update while make
556 * sure there is only 1 writer as well.
557 *
558 * @returns VBox status code.
559 * @param pVM The cross context VM structure.
560 * @param GCPhysWallClock Where the guest wall-clock structure is located.
561 *
562 * @remarks Don't do any release assertions here, these can be triggered by
563 * guest R0 code.
564 */
565VMMR3_INT_DECL(int) gimR3KvmEnableWallClock(PVM pVM, RTGCPHYS GCPhysWallClock)
566{
567 KVMWALLCLOCKINFO WallClockInfo;
568 WallClockInfo.GCPhysWallClock = GCPhysWallClock;
569 return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ONCE, gimR3KvmEnableWallClockCallback, &WallClockInfo);
570}
571
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette