VirtualBox

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

Last change on this file since 57008 was 56985, checked in by vboxsync, 9 years ago

VMM: Log and assertion formatting fixes.

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