aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorZachary Amsden <zamsden@redhat.com>2010-09-18 20:38:15 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:53:05 -0400
commitc285545f813d7b0ce989fd34e42ad1fe785dc65d (patch)
tree34c5aa4febe52e14e96d03b1a4f719ef9b357c85 /arch/x86/include
parent34c238a1d1832d7b1f655641f52782e86396b30a (diff)
KVM: x86: TSC catchup mode
Negate the effects of AN TYM spell while kvm thread is preempted by tracking conversion factor to the highest TSC rate and catching the TSC up when it has fallen behind the kernel view of time. Note that once triggered, we don't turn off catchup mode. A slightly more clever version of this is possible, which only does catchup when TSC rate drops, and which specifically targets only CPUs with broken TSC, but since these all are considered unstable_tsc(), this patch covers all necessary cases. Signed-off-by: Zachary Amsden <zamsden@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/kvm_host.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 519d6f78498..9e6fe391094 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -384,6 +384,9 @@ struct kvm_vcpu_arch {
384 u64 last_host_tsc; 384 u64 last_host_tsc;
385 u64 last_guest_tsc; 385 u64 last_guest_tsc;
386 u64 last_kernel_ns; 386 u64 last_kernel_ns;
387 u64 last_tsc_nsec;
388 u64 last_tsc_write;
389 bool tsc_catchup;
387 390
388 bool nmi_pending; 391 bool nmi_pending;
389 bool nmi_injected; 392 bool nmi_injected;
@@ -444,6 +447,9 @@ struct kvm_arch {
444 u64 last_tsc_nsec; 447 u64 last_tsc_nsec;
445 u64 last_tsc_offset; 448 u64 last_tsc_offset;
446 u64 last_tsc_write; 449 u64 last_tsc_write;
450 u32 virtual_tsc_khz;
451 u32 virtual_tsc_mult;
452 s8 virtual_tsc_shift;
447 453
448 struct kvm_xen_hvm_config xen_hvm_config; 454 struct kvm_xen_hvm_config xen_hvm_config;
449 455