Lines Matching refs:TSC
9 3) TSC Hardware
34 First we discuss the basic hardware devices available. TSC and the related
312 3) TSC Hardware
314 The TSC or time stamp counter is relatively simple in theory; it counts
319 The TSC is represented internally as a 64-bit MSR which can be read with the
321 limitations made it possible to write the TSC, but generally on old hardware it
326 write the TSC MSR is not an architectural guarantee.
328 The TSC is accessible from CPL-0 and conditionally, for CPL > 0 software by
329 means of the CR4.TSD bit, which when enabled, disables CPL > 0 TSC access.
332 atomically not just the TSC, but an indicator which corresponds to the
333 processor number. This can be used to index into an array of TSC variables to
339 allows the guest visible TSC to be offset by a constant. Newer implementations
340 promise to allow the TSC to additionally be scaled, but this hardware is not
343 3.1) TSC synchronization
345 The TSC is a CPU-local clock in most implementations. This means, on SMP
353 write the full 64-bits of the TSC, it may be impossible to match the TSC in
356 practice, getting a perfectly synchronized TSC will not be possible unless all
360 3.2) TSC and CPU hotplug
363 may not have a TSC value that is synchronized with the rest of the system.
364 Either system software, BIOS, or SMM code may actually try to establish the TSC
367 TSC is synchronized back to a state where TSC synchronization flaws, however
370 3.3) TSC and multi-socket / NUMA
388 3.4) TSC and C-states
391 states may be problematic for TSC as well. The TSC may stop advancing in such
392 a state, resulting in a TSC which is behind that of other CPUs when execution
396 The TSC in such a case may be corrected by catching it up to a known external
399 3.5) TSC frequency change / P-states
402 may or may not run the TSC at the same rate, and because the frequency change
403 may be staggered or slewed, at some points in time, the TSC rate may not be
404 known other than falling within a range of values. In this case, the TSC will
408 Whether the TSC runs at a constant rate or scales with the P-state is model
415 other processors. In such cases, the TSC on halted CPUs could advance faster
419 3.6) TSC and STPCLK / T-states
422 the TSC. This is typically done for thermal emergency power control to prevent
426 3.7) TSC virtualization - VMX
429 instructions, which is enough for full virtualization of TSC in any manner. In
430 addition, VMX allows passing through the host TSC plus an additional TSC_OFFSET
434 3.8) TSC virtualization - SVM
437 instructions, which is enough for full virtualization of TSC in any manner. In
438 addition, SVM allows passing through the host TSC plus an additional offset
441 3.9) TSC feature bits in Linux
443 In summary, there is no way to guarantee the TSC remains in perfect
448 The following feature bits are used by Linux to signal various TSC attributes,
451 X86_FEATURE_TSC : The TSC is available in hardware
453 X86_FEATURE_CONSTANT_TSC : The TSC rate is unchanged with P-states
454 X86_FEATURE_NONSTOP_TSC : The TSC does not stop in C-states
455 X86_FEATURE_TSC_RELIABLE : TSC sync checks are skipped (VMware)
505 4.2) TSC sampling and serialization
510 potentially unsynchronized source. One issue which is not unique to the TSC,
517 measurement with the TSC, and requires a serializing instruction, such as CPUID
524 the TSC as seen from other CPUs, even in an otherwise perfectly synchronized
529 Additionally, this lack of serialization from the TSC poses another challenge
530 when using results of the TSC when measured against another time source. As
531 the TSC is much higher precision, many possible values of the TSC may be read
536 fluctuates - from (T-1.. T+10). Thus, any time calculated from a TSC, but
548 and any other values derived from TSC computation (such as TSC virtualization
559 An additional concern is that timers based off the TSC (or HPET, if the raw bus
562 migrating to a faster machine may preclude the use of a passthrough TSC, as a
566 simply storing multipliers and offsets against the TSC for the guest to convert