Changeset 84044 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Apr 28, 2020 12:01:07 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137617
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/GIMKvm.cpp
r83372 r84044 415 415 SystemTime.u32TscScale = ASMDivU64ByU32RetU32(RT_NS_1SEC_64 << 32, uTscFreqLo); 416 416 417 /* For informational purposes, back-calculate the exact TSC frequency the guest will see. 418 * Note that the frequency is in kHz, not Hz, since that's what Linux uses. 419 */ 420 uint64_t uTscKHz; 421 422 uTscKHz = (RT_NS_1MS_64 << 32) / SystemTime.u32TscScale; 423 if (SystemTime.i8TscShift < 0) 424 uTscKHz <<= -SystemTime.i8TscShift; 425 else 426 uTscKHz >>= SystemTime.i8TscShift; 427 417 428 /* 418 429 * Update guest memory with the system-time struct. Technically we are cheating 419 430 * by only writing the struct once with the version incremented by two; in reality, 420 * the system-time struct is enabled once by the boot CPU and not concurrently read421 * by other VCPUs at the same time.431 * the system-time struct is enabled once for each CPU at boot and not concurrently 432 * read by other VCPUs at the same time. 422 433 */ 423 434 Assert(!(SystemTime.u32Version & UINT32_C(1))); … … 426 437 { 427 438 LogRel(("GIM: KVM: VCPU%3d: Enabled system-time struct. at %#RGp - u32TscScale=%#RX32 i8TscShift=%d uVersion=%#RU32 " 428 "fFlags=%#x uTsc=%#RX64 uVirtNanoTS=%#RX64 \n", pVCpu->idCpu, pKvmCpu->GCPhysSystemTime, SystemTime.u32TscScale,429 SystemTime.i8TscShift, SystemTime.u32Version, SystemTime.fFlags, pKvmCpu->uTsc, pKvmCpu->uVirtNanoTS ));439 "fFlags=%#x uTsc=%#RX64 uVirtNanoTS=%#RX64 TscKHz=%RU64\n", pVCpu->idCpu, pKvmCpu->GCPhysSystemTime, SystemTime.u32TscScale, 440 SystemTime.i8TscShift, SystemTime.u32Version, SystemTime.fFlags, pKvmCpu->uTsc, pKvmCpu->uVirtNanoTS, uTscKHz)); 430 441 TMR3CpuTickParavirtEnable(pVM); 431 442 }
Note:
See TracChangeset
for help on using the changeset viewer.