aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/lapic.c7
-rw-r--r--arch/x86/kvm/x86.c9
-rw-r--r--arch/x86/kvm/x86.h1
3 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 3eb7f8d9992c..a688fbffb34e 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1076,16 +1076,11 @@ static void apic_timer_expired(struct kvm_lapic *apic)
1076 wait_queue_head_t *q = &vcpu->wq; 1076 wait_queue_head_t *q = &vcpu->wq;
1077 struct kvm_timer *ktimer = &apic->lapic_timer; 1077 struct kvm_timer *ktimer = &apic->lapic_timer;
1078 1078
1079 /*
1080 * Note: KVM_REQ_PENDING_TIMER is implicitly checked in
1081 * vcpu_enter_guest.
1082 */
1083 if (atomic_read(&apic->lapic_timer.pending)) 1079 if (atomic_read(&apic->lapic_timer.pending))
1084 return; 1080 return;
1085 1081
1086 atomic_inc(&apic->lapic_timer.pending); 1082 atomic_inc(&apic->lapic_timer.pending);
1087 /* FIXME: this code should not know anything about vcpus */ 1083 kvm_set_pending_timer(vcpu);
1088 kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
1089 1084
1090 if (waitqueue_active(q)) 1085 if (waitqueue_active(q))
1091 wake_up_interruptible(q); 1086 wake_up_interruptible(q);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 559e3fd6c897..49ecda7ca958 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1087,6 +1087,15 @@ static void update_pvclock_gtod(struct timekeeper *tk)
1087} 1087}
1088#endif 1088#endif
1089 1089
1090void kvm_set_pending_timer(struct kvm_vcpu *vcpu)
1091{
1092 /*
1093 * Note: KVM_REQ_PENDING_TIMER is implicitly checked in
1094 * vcpu_enter_guest. This function is only called from
1095 * the physical CPU that is running vcpu.
1096 */
1097 kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
1098}
1090 1099
1091static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock) 1100static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
1092{ 1101{
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 07994f38dacf..f5fef1868096 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -147,6 +147,7 @@ static inline void kvm_register_writel(struct kvm_vcpu *vcpu,
147 147
148void kvm_before_handle_nmi(struct kvm_vcpu *vcpu); 148void kvm_before_handle_nmi(struct kvm_vcpu *vcpu);
149void kvm_after_handle_nmi(struct kvm_vcpu *vcpu); 149void kvm_after_handle_nmi(struct kvm_vcpu *vcpu);
150void kvm_set_pending_timer(struct kvm_vcpu *vcpu);
150int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip); 151int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip);
151 152
152void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr); 153void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr);