diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:29:03 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:29:15 -0500 |
commit | b48aa97e38206a84bf8485e7c553412274708ce5 (patch) | |
tree | 360f44bce8cf39836e916f3b5ed5c2e8849cd263 /arch/x86/include | |
parent | 42897d866b120547777ae1fd316680ec53356d9c (diff) |
KVM: x86: require matched TSC offsets for master clock
With master clock, a pvclock clock read calculates:
ret = system_timestamp + [ (rdtsc + tsc_offset) - tsc_timestamp ]
Where 'rdtsc' is the host TSC.
system_timestamp and tsc_timestamp are unique, one tuple
per VM: the "master clock".
Given a host with synchronized TSCs, its obvious that
guest TSC must be matched for the above to guarantee monotonicity.
Allow master clock usage only if guest TSCs are synchronized.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 32f0e4a063b7..9fb6d8da7a43 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -561,6 +561,7 @@ struct kvm_arch { | |||
561 | u64 cur_tsc_write; | 561 | u64 cur_tsc_write; |
562 | u64 cur_tsc_offset; | 562 | u64 cur_tsc_offset; |
563 | u8 cur_tsc_generation; | 563 | u8 cur_tsc_generation; |
564 | int nr_vcpus_matched_tsc; | ||
564 | 565 | ||
565 | spinlock_t pvclock_gtod_sync_lock; | 566 | spinlock_t pvclock_gtod_sync_lock; |
566 | bool use_master_clock; | 567 | bool use_master_clock; |