/* * Definitions for the clocksource provided by the Hyper-V * hypervisor to guest VMs, as described in the Hyper-V Top * Level Functional Spec (TLFS). * * Copyright (C) 2019, Microsoft, Inc. * * Author: Michael Kelley <mikelley@microsoft.com>
*/
/* * The protocol for reading Hyper-V TSC page is specified in Hypervisor * Top-Level Functional Specification ver. 3.0 and above. To get the * reference time we must do the following: * - READ ReferenceTscSequence * A special '0' value indicates the time source is unreliable and we * need to use something else. The currently published specification * versions (up to 4.0b) contain a mistake and wrongly claim '-1' * instead of '0' as the special value, see commit c35b82ef0294. * - ReferenceTime = * ((RDTSC() * ReferenceTscScale) >> 64) + ReferenceTscOffset * - READ ReferenceTscSequence again. In case its value has changed * since our first reading we need to discard ReferenceTime and repeat * the whole sequence as the hypervisor was updating the page in * between.
*/ do {
sequence = READ_ONCE(tsc_pg->tsc_sequence); if (!sequence) returnfalse; /* * Make sure we read sequence before we read other values from * TSC page.
*/
smp_rmb();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.