KVM: arm/arm64: Remove the IRQ field from struct irq_phys_map
[deliverable/linux.git] / virt / kvm / arm / arch_timer.c
index 962b442d0d773ec6b610f557ed52dadff39818ac..e45895a0153da255fd2e1b5c3583a9461e5d03c2 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/kvm.h>
 #include <linux/kvm_host.h>
 #include <linux/interrupt.h>
+#include <linux/irq.h>
 
 #include <clocksource/arm_arch_timer.h>
 #include <asm/arch_timer.h>
@@ -300,7 +301,7 @@ void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
        if (timer->active_cleared_last && !phys_active)
                return;
 
-       ret = irq_set_irqchip_state(timer->map->irq,
+       ret = irq_set_irqchip_state(host_vtimer_irq,
                                    IRQCHIP_STATE_ACTIVE,
                                    phys_active);
        WARN_ON(ret);
@@ -333,6 +334,9 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
 {
        struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
        struct irq_phys_map *map;
+       struct irq_desc *desc;
+       struct irq_data *data;
+       int phys_irq;
 
        /*
         * The vcpu timer irq number cannot be determined in
@@ -351,11 +355,26 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
        timer->cntv_ctl = 0;
        kvm_timer_update_state(vcpu);
 
+       /*
+        * Find the physical IRQ number corresponding to the host_vtimer_irq
+        */
+       desc = irq_to_desc(host_vtimer_irq);
+       if (!desc) {
+               kvm_err("%s: no interrupt descriptor\n", __func__);
+               return -EINVAL;
+       }
+
+       data = irq_desc_get_irq_data(desc);
+       while (data->parent_data)
+               data = data->parent_data;
+
+       phys_irq = data->hwirq;
+
        /*
         * Tell the VGIC that the virtual interrupt is tied to a
         * physical interrupt. We do that once per VCPU.
         */
-       map = kvm_vgic_map_phys_irq(vcpu, irq->irq, host_vtimer_irq);
+       map = kvm_vgic_map_phys_irq(vcpu, irq->irq, phys_irq);
        if (WARN_ON(IS_ERR(map)))
                return PTR_ERR(map);
 
This page took 0.052297 seconds and 5 git commands to generate.