Skip to content

Commit

Permalink
refactor: Disable TSC scaling for PVM
Browse files Browse the repository at this point in the history
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
  • Loading branch information
pojntfx committed Dec 4, 2024
1 parent e65e30f commit ff49ea8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vmm/src/vstate/vcpu/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,12 @@ impl KvmVcpu {
}

/// Scale the TSC frequency of this vCPU to the one provided as a parameter.
pub fn set_tsc_khz(&self, tsc_freq: u32) -> Result<(), SetTscError> {
self.fd.set_tsc_khz(tsc_freq).map_err(SetTscError)
pub fn set_tsc_khz(&self, _: u32) -> Result<(), SetTscError> {
// Disable TSC scaling when using PVM because it is unsupported on most virtualized platforms.
// Even on supported platforms like virtualized AMD CPUs, enabling TSC scaling can cause VM freezes
// after resuming from a snapshot.
// For more details, see https://github.com/virt-pvm/linux/issues/12#issue-2515360332
Ok(())
}

/// Use provided state to populate KVM internal state.
Expand Down

0 comments on commit ff49ea8

Please sign in to comment.