Skip to content

Commit 95c9dd7

Browse files
author
dylanwongtencent
committed
PVM: no-KVM Firecracker support on latest upstream
1 parent becc4b7 commit 95c9dd7

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/vmm/src/arch/x86_64/vcpu.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,12 @@ impl KvmVcpu {
640640
}
641641

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

647651
/// Use provided state to populate KVM internal state.

src/vmm/src/cpu_config/x86_64/custom_cpu_template.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ impl GetCpuTemplate for Option<CpuTemplateType> {
3939

4040
let cpu_model = CpuModel::get_cpu_model();
4141
if !template.get_supported_cpu_models().contains(&cpu_model) {
42-
return Err(InvalidCpuModel);
42+
// Disable the CPU compatibility check to allow using templates like T2A on more modern CPUs
43+
// return Err(InvalidCpuModel);
4344
}
4445

4546
match template {

0 commit comments

Comments
 (0)