diff --git a/hypervisor/src/cpu.rs b/hypervisor/src/cpu.rs
index 777f571f0..ffecd1e46 100644
--- a/hypervisor/src/cpu.rs
+++ b/hypervisor/src/cpu.rs
@@ -311,6 +311,18 @@ pub enum HypervisorCpuError {
///
#[error("Failed to set TSC frequency")]
SetTscKhz(#[source] anyhow::Error),
+ #[cfg(target_arch = "x86_64")]
+ ///
+ /// Error getting TSC offset
+ ///
+ #[error("Failed to get TSC offset")]
+ GetTscOffset(#[source] anyhow::Error),
+ #[cfg(target_arch = "x86_64")]
+ ///
+ /// Error setting TSC offset
+ ///
+ #[error("Failed to set TSC offset")]
+ SetTscOffset(#[source] anyhow::Error),
///
/// Error reading value at given GPA
///
@@ -614,6 +626,21 @@ pub trait Vcpu: Send + Sync {
}
#[cfg(target_arch = "x86_64")]
///
+ /// Read the vCPU's TSC offset, or `None` when the hypervisor does not
+ /// expose it.
+ ///
+ fn tsc_offset(&self) -> Result