kvm: x86: Remove kvm_make_request from lapic.c
authorNicholas Krause <xerofoify@gmail.com>
Fri, 2 Jan 2015 03:05:18 +0000 (22:05 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Jan 2015 21:48:08 +0000 (22:48 +0100)
Adds a function kvm_vcpu_set_pending_timer instead of calling
kvm_make_request in lapic.c.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h

index 3eb7f8d9992c6880c4712b074189834adc22cf2a..a688fbffb34e0aeaa40c1cda3e021a7e6d22cbe2 100644 (file)
@@ -1076,16 +1076,11 @@ static void apic_timer_expired(struct kvm_lapic *apic)
        wait_queue_head_t *q = &vcpu->wq;
        struct kvm_timer *ktimer = &apic->lapic_timer;
 
-       /*
-        * Note: KVM_REQ_PENDING_TIMER is implicitly checked in
-        * vcpu_enter_guest.
-        */
        if (atomic_read(&apic->lapic_timer.pending))
                return;
 
        atomic_inc(&apic->lapic_timer.pending);
-       /* FIXME: this code should not know anything about vcpus */
-       kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
+       kvm_set_pending_timer(vcpu);
 
        if (waitqueue_active(q))
                wake_up_interruptible(q);
index 559e3fd6c8970e961157771df0f867b3ad9b727e..49ecda7ca9581349fb1cdc8c7962632f61b14e15 100644 (file)
@@ -1087,6 +1087,15 @@ static void update_pvclock_gtod(struct timekeeper *tk)
 }
 #endif
 
+void kvm_set_pending_timer(struct kvm_vcpu *vcpu)
+{
+       /*
+        * Note: KVM_REQ_PENDING_TIMER is implicitly checked in
+        * vcpu_enter_guest.  This function is only called from
+        * the physical CPU that is running vcpu.
+        */
+       kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
+}
 
 static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
 {
index 07994f38dacf2cb4cc780bddf70fb32cb0f11d93..f5fef18680964164263c5fb111bf55e68bd3655c 100644 (file)
@@ -147,6 +147,7 @@ static inline void kvm_register_writel(struct kvm_vcpu *vcpu,
 
 void kvm_before_handle_nmi(struct kvm_vcpu *vcpu);
 void kvm_after_handle_nmi(struct kvm_vcpu *vcpu);
+void kvm_set_pending_timer(struct kvm_vcpu *vcpu);
 int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);
 
 void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr);