Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133717
b: refs/heads/master
c: 4780c65
h: refs/heads/master
i:
  133715: e3ebd0b
v: v3
  • Loading branch information
Avi Kivity committed Mar 24, 2009
1 parent 98411dc commit a96af07
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 75858a84a6207f5e60196f6bbd18fde4250e5759
refs/heads/master: 4780c65904f0fc4e312ee2da9383eacbe04e61ea
15 changes: 15 additions & 0 deletions trunk/arch/x86/kvm/i8254.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,16 @@ void kvm_pit_reset(struct kvm_pit *pit)
pit->pit_state.irq_ack = 1;
}

static void pit_mask_notifer(struct kvm_irq_mask_notifier *kimn, bool mask)
{
struct kvm_pit *pit = container_of(kimn, struct kvm_pit, mask_notifier);

if (!mask) {
atomic_set(&pit->pit_state.pit_timer.pending, 0);
pit->pit_state.irq_ack = 1;
}
}

struct kvm_pit *kvm_create_pit(struct kvm *kvm)
{
struct kvm_pit *pit;
Expand Down Expand Up @@ -586,6 +596,9 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm)

kvm_pit_reset(pit);

pit->mask_notifier.func = pit_mask_notifer;
kvm_register_irq_mask_notifier(kvm, 0, &pit->mask_notifier);

return pit;
}

Expand All @@ -594,6 +607,8 @@ void kvm_free_pit(struct kvm *kvm)
struct hrtimer *timer;

if (kvm->arch.vpit) {
kvm_unregister_irq_mask_notifier(kvm, 0,
&kvm->arch.vpit->mask_notifier);
mutex_lock(&kvm->arch.vpit->pit_state.lock);
timer = &kvm->arch.vpit->pit_state.pit_timer.timer;
hrtimer_cancel(timer);
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/kvm/i8254.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct kvm_pit {
struct kvm *kvm;
struct kvm_kpit_state pit_state;
int irq_source_id;
struct kvm_irq_mask_notifier mask_notifier;
};

#define KVM_PIT_BASE_ADDRESS 0x40
Expand Down

0 comments on commit a96af07

Please sign in to comment.