|
@@ -200,7 +200,6 @@ int __pit_timer_fn(struct kvm_kpit_state *ps)
|
|
|
|
|
|
atomic_inc(&pt->pending);
|
|
atomic_inc(&pt->pending);
|
|
smp_mb__after_atomic_inc();
|
|
smp_mb__after_atomic_inc();
|
|
- /* FIXME: handle case where the guest is in guest mode */
|
|
|
|
if (vcpu0 && waitqueue_active(&vcpu0->wq)) {
|
|
if (vcpu0 && waitqueue_active(&vcpu0->wq)) {
|
|
vcpu0->arch.mp_state = KVM_MP_STATE_RUNNABLE;
|
|
vcpu0->arch.mp_state = KVM_MP_STATE_RUNNABLE;
|
|
wake_up_interruptible(&vcpu0->wq);
|
|
wake_up_interruptible(&vcpu0->wq);
|
|
@@ -237,6 +236,19 @@ static enum hrtimer_restart pit_timer_fn(struct hrtimer *data)
|
|
return HRTIMER_NORESTART;
|
|
return HRTIMER_NORESTART;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu)
|
|
|
|
+{
|
|
|
|
+ struct kvm_pit *pit = vcpu->kvm->arch.vpit;
|
|
|
|
+ struct hrtimer *timer;
|
|
|
|
+
|
|
|
|
+ if (vcpu->vcpu_id != 0 || !pit)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ timer = &pit->pit_state.pit_timer.timer;
|
|
|
|
+ if (hrtimer_cancel(timer))
|
|
|
|
+ hrtimer_start(timer, timer->expires, HRTIMER_MODE_ABS);
|
|
|
|
+}
|
|
|
|
+
|
|
static void destroy_pit_timer(struct kvm_kpit_timer *pt)
|
|
static void destroy_pit_timer(struct kvm_kpit_timer *pt)
|
|
{
|
|
{
|
|
pr_debug("pit: execute del timer!\n");
|
|
pr_debug("pit: execute del timer!\n");
|