mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
kvmclock: reduce kvmclock difference on migration
Check for KVM_CAP_ADJUST_CLOCK capability KVM_CLOCK_TSC_STABLE, which indicates that KVM_GET_CLOCK returns a value as seen by the guest at that moment. For new machine types, use this value rather than reading from guest memory. This reduces kvmclock difference on migration from 5s to 0.1s (when max_downtime == 5s). Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Message-Id: <20161121105052.598267440@redhat.com> [Add comment explaining what is going on. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
bc20403598
commit
6053a86fe7
4 changed files with 140 additions and 15 deletions
|
@ -117,6 +117,13 @@ bool kvm_has_smm(void)
|
|||
return kvm_check_extension(kvm_state, KVM_CAP_X86_SMM);
|
||||
}
|
||||
|
||||
bool kvm_has_adjust_clock_stable(void)
|
||||
{
|
||||
int ret = kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK);
|
||||
|
||||
return (ret == KVM_CLOCK_TSC_STABLE);
|
||||
}
|
||||
|
||||
bool kvm_allows_irq0_override(void)
|
||||
{
|
||||
return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
bool kvm_allows_irq0_override(void);
|
||||
bool kvm_has_smm(void);
|
||||
bool kvm_has_adjust_clock_stable(void);
|
||||
void kvm_synchronize_all_tsc(void);
|
||||
void kvm_arch_reset_vcpu(X86CPU *cs);
|
||||
void kvm_arch_do_init_vcpu(X86CPU *cs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue