KVM: unify part of generic timer handling
Hide the internals of vcpu awakening / injection from the in-kernel emulated timers. This makes future changes in this logic easier and decreases the distance to more generic timer handling. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:

committed by
Avi Kivity

parent
fd66842370
commit
d3c7b77d1a
18
arch/x86/kvm/kvm_timer.h
Normal file
18
arch/x86/kvm/kvm_timer.h
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
struct kvm_timer {
|
||||
struct hrtimer timer;
|
||||
s64 period; /* unit: ns */
|
||||
atomic_t pending; /* accumulated triggered timers */
|
||||
bool reinject;
|
||||
struct kvm_timer_ops *t_ops;
|
||||
struct kvm *kvm;
|
||||
int vcpu_id;
|
||||
};
|
||||
|
||||
struct kvm_timer_ops {
|
||||
bool (*is_periodic)(struct kvm_timer *);
|
||||
};
|
||||
|
||||
|
||||
enum hrtimer_restart kvm_timer_fn(struct hrtimer *data);
|
||||
|
Reference in New Issue
Block a user