KVM: Add vcpu info to ioapic_update_eoi()
authorYang Zhang <yang.z.zhang@Intel.com>
Thu, 11 Apr 2013 11:21:35 +0000 (19:21 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Tue, 16 Apr 2013 02:20:33 +0000 (23:20 -0300)
Add vcpu info to ioapic_update_eoi, so we can know which vcpu
issued this EOI.

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>
arch/x86/kvm/lapic.c
virt/kvm/ioapic.c
virt/kvm/ioapic.h

index e2274745ab3d6a2e31c8d735148c4fcebf5f331d..3e22536a703175f23875371865deda2e811262e1 100644 (file)
@@ -739,7 +739,7 @@ static void kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector)
                        trigger_mode = IOAPIC_LEVEL_TRIG;
                else
                        trigger_mode = IOAPIC_EDGE_TRIG;
-               kvm_ioapic_update_eoi(apic->vcpu->kvm, vector, trigger_mode);
+               kvm_ioapic_update_eoi(apic->vcpu, vector, trigger_mode);
        }
 }
 
index 914cbe027d066eaf4be3102fbbeb351783de1f85..1d8906d39214d96b0003ef7196cd23f1b27fed58 100644 (file)
@@ -264,8 +264,8 @@ void kvm_ioapic_clear_all(struct kvm_ioapic *ioapic, int irq_source_id)
        spin_unlock(&ioapic->lock);
 }
 
-static void __kvm_ioapic_update_eoi(struct kvm_ioapic *ioapic, int vector,
-                                    int trigger_mode)
+static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
+                       struct kvm_ioapic *ioapic, int vector, int trigger_mode)
 {
        int i;
 
@@ -304,12 +304,12 @@ bool kvm_ioapic_handles_vector(struct kvm *kvm, int vector)
        return test_bit(vector, ioapic->handled_vectors);
 }
 
-void kvm_ioapic_update_eoi(struct kvm *kvm, int vector, int trigger_mode)
+void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector, int trigger_mode)
 {
-       struct kvm_ioapic *ioapic = kvm->arch.vioapic;
+       struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic;
 
        spin_lock(&ioapic->lock);
-       __kvm_ioapic_update_eoi(ioapic, vector, trigger_mode);
+       __kvm_ioapic_update_eoi(vcpu, ioapic, vector, trigger_mode);
        spin_unlock(&ioapic->lock);
 }
 
@@ -407,7 +407,7 @@ static int ioapic_mmio_write(struct kvm_io_device *this, gpa_t addr, int len,
                break;
 #ifdef CONFIG_IA64
        case IOAPIC_REG_EOI:
-               __kvm_ioapic_update_eoi(ioapic, data, IOAPIC_LEVEL_TRIG);
+               __kvm_ioapic_update_eoi(NULL, ioapic, data, IOAPIC_LEVEL_TRIG);
                break;
 #endif
 
index 0400a466c50c55211323b67a5a4109784c3fcd74..2fc61a5013d2bb102bd9b65cc5aa2c0fbd45a5c2 100644 (file)
@@ -70,7 +70,8 @@ static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
 int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
                int short_hand, int dest, int dest_mode);
 int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2);
-void kvm_ioapic_update_eoi(struct kvm *kvm, int vector, int trigger_mode);
+void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector,
+                       int trigger_mode);
 bool kvm_ioapic_handles_vector(struct kvm *kvm, int vector);
 int kvm_ioapic_init(struct kvm *kvm);
 void kvm_ioapic_destroy(struct kvm *kvm);