Module tsc

Source
Expand description

Handles operations using platform Time Stamp Counter (TSC).

Modules§

calibrate 🔒
cpuid 🔒
grouping 🔒

Structs§

TscState
TscSyncMitigations

Enums§

TscCalibrationError

Statics§

TSC_STATE 🔒

Functions§

bus_freq_hz
Returns the Bus frequency in Hz, based on reading Intel-specific cpuids, or None if the frequency can’t be determined from cpuids.
calibrate_tsc_state
Calibrate the TSC state.
fake_tsc_frequency_cpuid
Given the tsc frequency in Hz and the bus frequency in Hz, return a fake version of cpuid leaf 0x15.
get_tsc_sync_mitigations
Given the state of the host TSCs in tsc_state, and the number of vcpus that are intended to be run, return a set of affinities and TSC offsets to apply to those vcpus.
rdtsc_safe 🔒
standard_deviation
Get the standard deviation of a Vec<T>.
tsc_freq_hz
Returns the TSC frequency in Hz, based on reading Intel-specific cpuids, or None if the frequency can’t be determined from cpuids.
tsc_frequency
Returns the frequency of the host TSC. Calibration only happens once.
tsc_frequency_cpuid
Gets the TSC frequency for cpuid leaf 0x15 from the existing leaves 0x15 and 0x16.
tsc_state
Returns the state of the host TSCs. Calibration only happens once.
tsc_sync_mitigations_inner 🔒

Type Aliases§

CpuidCountFn
Function to retrieve the given CPUID leaf and sub-leaf.