KVM: SVM: Ensure timestamp counter monotonicity
When a vcpu is migrated from one cpu to another, its timestamp counter may lose its monotonic property if the host has unsynced timestamp counters. This can confuse the guest, sometimes to the point of refusing to boot. As the rdtsc instruction is rather fast on AMD processors (7-10 cycles), we can simply record the last host tsc when we drop the cpu, and adjust the vcpu tsc offset when we detect that we've migrated to a different cpu. Signed-off-by: Avi Kivity <avi@qumranet.com>
Esse commit está contido em:
@@ -244,6 +244,7 @@ struct kvm_vcpu {
|
||||
struct mutex mutex;
|
||||
int cpu;
|
||||
int launched;
|
||||
u64 host_tsc;
|
||||
struct kvm_run *run;
|
||||
int interrupt_window_open;
|
||||
unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
|
||||
|
Referência em uma nova issue
Block a user