aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@Intel.com>2013-04-11 07:25:14 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2013-04-16 15:32:40 -0400
commitcf9e65b773394c5ad8fa7455c43268bc8ec2109f (patch)
treedea4e116da3ecc13c8b6383ec2145a73480d66f0 /virt
parent3d81bc7e96d6bca0b8f8b7d1bf6ea72caa3aac57 (diff)
KVM: Set TMR when programming ioapic entry
We already know the trigger mode of a given interrupt when programming the ioapice entry. So it's not necessary to set it in each interrupt delivery. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/ioapic.c12
-rw-r--r--virt/kvm/ioapic.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index f2157a985a1f..2d682977ce82 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -193,7 +193,8 @@ static void update_handled_vectors(struct kvm_ioapic *ioapic)
193 smp_wmb(); 193 smp_wmb();
194} 194}
195 195
196void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap) 196void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap,
197 u32 *tmr)
197{ 198{
198 struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic; 199 struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic;
199 union kvm_ioapic_redirect_entry *e; 200 union kvm_ioapic_redirect_entry *e;
@@ -207,8 +208,13 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap)
207 kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, 208 kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC,
208 index) || index == RTC_GSI)) { 209 index) || index == RTC_GSI)) {
209 if (kvm_apic_match_dest(vcpu, NULL, 0, 210 if (kvm_apic_match_dest(vcpu, NULL, 0,
210 e->fields.dest_id, e->fields.dest_mode)) 211 e->fields.dest_id, e->fields.dest_mode)) {
211 __set_bit(e->fields.vector, (unsigned long *)eoi_exit_bitmap); 212 __set_bit(e->fields.vector,
213 (unsigned long *)eoi_exit_bitmap);
214 if (e->fields.trig_mode == IOAPIC_LEVEL_TRIG)
215 __set_bit(e->fields.vector,
216 (unsigned long *)tmr);
217 }
212 } 218 }
213 } 219 }
214 spin_unlock(&ioapic->lock); 220 spin_unlock(&ioapic->lock);
diff --git a/virt/kvm/ioapic.h b/virt/kvm/ioapic.h
index 674a388612b4..615d8c995c3c 100644
--- a/virt/kvm/ioapic.h
+++ b/virt/kvm/ioapic.h
@@ -97,6 +97,7 @@ int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
97int kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state); 97int kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
98int kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state); 98int kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state);
99void kvm_vcpu_request_scan_ioapic(struct kvm *kvm); 99void kvm_vcpu_request_scan_ioapic(struct kvm *kvm);
100void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap); 100void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap,
101 u32 *tmr);
101 102
102#endif 103#endif