[PATCH] KVM: x86: fix cpu hang due to tsc adjustment when kvmclock in use

2021-03-03 Thread ann.zhuangyanying
From: Zhuang Yanying If the TSC frequency of the VM is not equal to the host, hot-plugging vCPU will cause the VM to be hang. The time of hang depends on the current TSC value of the VM. System time calculation of kvmclock is based on (tsc_timestamp, system_time), and adjusted by delta ( = rdtsc

[PATCH] KVM: x86: fix cpu hang due to tsc adjustment when kvmclock in use

2021-03-03 Thread ann.zhuangyanying
From: Zhuang Yanying If the TSC frequency of the VM is not equal to the host, hot-plugging vCPU will cause the VM to be hang. The time of hang depends on the current TSC value of the VM. System time calculation of kvmclock is based on (tsc_timestamp, system_time), and adjusted by delta ( = rdtsc

[PATCH] KVM: x86: fix Hot-plugged cpu hang when Configured tsc-frequency is not equal to host

2021-02-27 Thread ann.zhuangyanying
From: Zhuang Yanying If the TSC frequency of the VM is not equal to the host, hot-plugging vCPU will cause the VM to be hang. The time of hang depends on the current TSC value of the VM. During hot-plugging vCPUs, kvm_arch_vcpu_create() uses max_tsc_khz, that is the host TSC frequency, to initia