aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorZachary Amsden <zamsden@redhat.com>2010-08-20 04:07:17 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:22 -0400
commit99e3e30aee1a326a98bf3a5f47b8622219c685f3 (patch)
tree1b67fc70af33988080784d32725f72b5ce7c07d1 /arch/x86/include
parentf4e1b3c8bd2a044cd0ccf80595bfd088a49fe60b (diff)
KVM: x86: Move TSC offset writes to common code
Also, ensure that the storing of the offset and the reading of the TSC are never preempted by taking a spinlock. While the lock is overkill now, it is useful later in this patch series. 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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 6056a23dc4cf..a215153f1ff6 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -395,6 +395,7 @@ struct kvm_arch {
395 395
396 unsigned long irq_sources_bitmap; 396 unsigned long irq_sources_bitmap;
397 s64 kvmclock_offset; 397 s64 kvmclock_offset;
398 spinlock_t tsc_write_lock;
398 399
399 struct kvm_xen_hvm_config xen_hvm_config; 400 struct kvm_xen_hvm_config xen_hvm_config;
400 401
@@ -521,6 +522,8 @@ struct kvm_x86_ops {
521 522
522 bool (*has_wbinvd_exit)(void); 523 bool (*has_wbinvd_exit)(void);
523 524
525 void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset);
526
524 const struct trace_print_flags *exit_reasons_str; 527 const struct trace_print_flags *exit_reasons_str;
525}; 528};
526 529