Skip to content

Commit a7e33ad

Browse files
Andre-ARMchazy
authored andcommitted
KVM: arm/arm64: arch_timer: Remove irq_phys_map
Now that the interface between the arch timer and the VGIC does not require passing the irq_phys_map entry pointer anymore, let's remove it from the virtual arch timer and use the virtual IRQ number instead directly. The remaining pointer returned by kvm_vgic_map_phys_irq() will be removed in the following patch. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Eric Auger <eric.auger@linaro.org> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
1 parent b452cb5 commit a7e33ad

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

‎include/kvm/arm_arch_timer.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ struct arch_timer_cpu {
5353
/* Timer IRQ */
5454
struct kvm_irq_level irq;
5555

56-
/* VGIC mapping */
57-
struct irq_phys_map *map;
58-
5956
/* Active IRQ state caching */
6057
bool active_cleared_last;
6158
};

‎virt/kvm/arm/arch_timer.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level)
175175

176176
timer->active_cleared_last = false;
177177
timer->irq.level = new_level;
178-
trace_kvm_timer_update_irq(vcpu->vcpu_id, timer->map->virt_irq,
178+
trace_kvm_timer_update_irq(vcpu->vcpu_id, timer->irq.irq,
179179
timer->irq.level);
180180
ret = kvm_vgic_inject_mapped_irq(vcpu->kvm, vcpu->vcpu_id,
181-
timer->map->virt_irq,
181+
timer->irq.irq,
182182
timer->irq.level);
183183
WARN_ON(ret);
184184
}
@@ -276,7 +276,7 @@ void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
276276
* exit.
277277
*/
278278
phys_active = timer->irq.level ||
279-
kvm_vgic_map_is_active(vcpu, timer->map->virt_irq);
279+
kvm_vgic_map_is_active(vcpu, timer->irq.irq);
280280

281281
/*
282282
* We want to avoid hitting the (re)distributor as much as
@@ -378,7 +378,6 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
378378
if (WARN_ON(IS_ERR(map)))
379379
return PTR_ERR(map);
380380

381-
timer->map = map;
382381
return 0;
383382
}
384383

@@ -504,8 +503,7 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu)
504503
struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
505504

506505
timer_disarm(timer);
507-
if (timer->map)
508-
kvm_vgic_unmap_phys_irq(vcpu, timer->map->virt_irq);
506+
kvm_vgic_unmap_phys_irq(vcpu, timer->irq.irq);
509507
}
510508

511509
void kvm_timer_enable(struct kvm *kvm)

0 commit comments

Comments
 (0)