]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
kvm: x86: Track irq vectors in ioapic->rtc_status.dest_map
authorJoerg Roedel <jroedel@suse.de>
Wed, 14 Dec 2016 22:04:20 +0000 (16:04 -0600)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 25 Jan 2017 18:32:35 +0000 (16:32 -0200)
BugLink: http://bugs.launchpad.net/bugs/1649718
This allows backtracking later in case the rtc irq has been
moved to another vcpu/vector.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 9daa50076f585854f0040aa8403eac020d6f5d64)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
arch/x86/kvm/ioapic.h
arch/x86/kvm/lapic.c

index af729890f6f550361251f7ee3001b3d0e9a5746d..7d2692a4965756143825d65d37688837d82aaca2 100644 (file)
@@ -41,7 +41,14 @@ struct kvm_vcpu;
 #endif
 
 struct dest_map {
+       /* vcpu bitmap where IRQ has been sent */
        DECLARE_BITMAP(map, KVM_MAX_VCPUS);
+
+       /*
+        * Vector sent to a given vcpu, only valid when
+        * the vcpu's bit in map is set
+        */
+       u8 vectors[KVM_MAX_VCPUS];
 };
 
 
index dbbd4146665603cb969e969578d7bb68b3793f25..a3bcff59300ef165055cdd659dd2fc352e5951fc 100644 (file)
@@ -839,8 +839,10 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
 
                result = 1;
 
-               if (dest_map)
+               if (dest_map) {
                        __set_bit(vcpu->vcpu_id, dest_map->map);
+                       dest_map->vectors[vcpu->vcpu_id] = vector;
+               }
 
                if (apic_test_vector(vector, apic->regs + APIC_TMR) != !!trig_mode) {
                        if (trig_mode)