Changeset 56791 in vbox for trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp
- Timestamp:
- Jul 3, 2015 4:19:59 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101441
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp
r56693 r56791 358 358 SSMR3GetGCPhys(pSSM, &pKvmCpu->GCPhysSystemTime); 359 359 SSMR3GetU32(pSSM, &pKvmCpu->u32SystemTimeVersion); 360 rc = SSMR3GetU8(pSSM, & fSystemTimeFlags);360 rc = SSMR3GetU8(pSSM, &pKvmCpu->fSystemTimeFlags); 361 361 AssertRCReturn(rc, rc); 362 362 363 363 /* Enable the system-time struct. if necessary. */ 364 /** @todo update guest struct only if cTscTicksPerSecond doesn't match host 365 * anymore. */ 364 366 if (MSR_GIM_KVM_SYSTEM_TIME_IS_ENABLED(pKvmCpu->u64SystemTimeMsr)) 365 367 { 366 368 Assert(!TMVirtualIsTicking(pVM)); /* paranoia. */ 367 369 Assert(!TMCpuTickIsTicking(pVCpu)); 368 rc = gimR3KvmEnableSystemTime(pVM, pVCpu , pKvmCpu, fSystemTimeFlags);370 rc = gimR3KvmEnableSystemTime(pVM, pVCpu); 369 371 AssertRCReturn(rc, rc); 370 372 } … … 388 390 * @param pVM Pointer to the VM. 389 391 * @param pVCpu Pointer to the VMCPU. 390 * @param pKvmCpu Pointer to the GIMKVMCPU with all fields391 * populated by the caller.392 * @param fFlags The system-time struct. flags.393 392 * 394 393 * @remarks Don't do any release assertions here, these can be triggered by 395 394 * guest R0 code. 396 395 */ 397 VMMR3_INT_DECL(int) gimR3KvmEnableSystemTime(PVM pVM, PVMCPU pVCpu, PGIMKVMCPU pKvmCpu, uint8_t fFlags) 398 { 396 VMMR3_INT_DECL(int) gimR3KvmEnableSystemTime(PVM pVM, PVMCPU pVCpu) 397 { 398 PGIMKVM pKvm = &pVM->gim.s.u.Kvm; 399 PGIMKVMCPU pKvmCpu = &pVCpu->gim.s.u.KvmCpu; 400 399 401 /* 400 402 * Validate the mapping address first. … … 407 409 } 408 410 411 /* 412 * Construct the system-time struct. 413 */ 409 414 GIMKVMSYSTEMTIME SystemTime; 410 415 RT_ZERO(SystemTime); … … 412 417 SystemTime.u64NanoTS = pKvmCpu->uVirtNanoTS; 413 418 SystemTime.u64Tsc = pKvmCpu->uTsc; 414 SystemTime.fFlags = fFlags | GIM_KVM_SYSTEM_TIME_FLAGS_TSC_STABLE;419 SystemTime.fFlags = pKvmCpu->fSystemTimeFlags | GIM_KVM_SYSTEM_TIME_FLAGS_TSC_STABLE; 415 420 416 421 /* … … 424 429 * time = ((tsc * SysTime.u32TscScale) >> 32) + SysTime.u64NanoTS 425 430 */ 426 PGIMKVM pKvm = &pVM->gim.s.u.Kvm;427 431 uint64_t u64TscFreq = pKvm->cTscTicksPerSecond; 428 432 SystemTime.i8TscShift = 0; … … 440 444 SystemTime.u32TscScale = ASMDivU64ByU32RetU32(RT_NS_1SEC_64 << 32, uTscFreqLo); 441 445 446 /* 447 * Update guest memory with the system-time struct. 448 */ 442 449 Assert(!(SystemTime.u32Version & UINT32_C(1))); 443 450 int rc = PGMPhysSimpleWriteGCPhys(pVM, pKvmCpu->GCPhysSystemTime, &SystemTime, sizeof(GIMKVMSYSTEMTIME));
Note:
See TracChangeset
for help on using the changeset viewer.