Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329827
b: refs/heads/master
c: 9d9d223
h: refs/heads/master
i:
  329825: f5275c8
  329823: 5d77b50
v: v3
  • Loading branch information
Avi Kivity authored and Marcelo Tosatti committed Aug 1, 2012
1 parent e622cb2 commit d65ca09
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a6eac9638a92b61de04bac4233d8ca665ae96af
refs/heads/master: 9d9d2239bdecd525ce3eb6cbfe4abb925c98208c
14 changes: 1 addition & 13 deletions trunk/arch/x86/kvm/i8254.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,6 @@ static void destroy_pit_timer(struct kvm_pit *pit)
flush_kthread_work(&pit->expired);
}

static bool kpit_is_periodic(struct kvm_pit_timer *ktimer)
{
struct kvm_kpit_state *ps = container_of(ktimer, struct kvm_kpit_state,
pit_timer);
return ps->is_periodic;
}

static struct kvm_pit_timer_ops kpit_ops = {
.is_periodic = kpit_is_periodic,
};

static void pit_do_work(struct kthread_work *work)
{
struct kvm_pit *pit = container_of(work, struct kvm_pit, expired);
Expand Down Expand Up @@ -330,7 +319,7 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
queue_kthread_work(&pt->worker, &pt->expired);
}

if (ktimer->t_ops->is_periodic(ktimer)) {
if (pt->pit_state.is_periodic) {
hrtimer_add_expires_ns(&ktimer->timer, ktimer->period);
return HRTIMER_RESTART;
} else
Expand All @@ -357,7 +346,6 @@ static void create_pit_timer(struct kvm *kvm, u32 val, int is_period)
ps->is_periodic = is_period;

pt->timer.function = pit_timer_fn;
pt->t_ops = &kpit_ops;
pt->kvm = ps->pit->kvm;

atomic_set(&pt->pending, 0);
Expand Down
8 changes: 0 additions & 8 deletions trunk/arch/x86/kvm/i8254.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,9 @@ struct kvm_kpit_channel_state {
struct kvm_pit_timer {
struct hrtimer timer;
s64 period; /* unit: ns */
u32 timer_mode_mask;
u64 tscdeadline;
atomic_t pending; /* accumulated triggered timers */
bool reinject;
struct kvm_pit_timer_ops *t_ops;
struct kvm *kvm;
struct kvm_vcpu *vcpu;
};

struct kvm_pit_timer_ops {
bool (*is_periodic)(struct kvm_pit_timer *);
};

struct kvm_kpit_state {
Expand Down

0 comments on commit d65ca09

Please sign in to comment.