From: eric.auger@linaro•org (Eric Auger)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 6/7] KVM: arm/arm64: remove irq_phys_map from the arch timer
Date: Thu, 21 Apr 2016 19:56:03 +0200 [thread overview]
Message-ID: <57191433.40508@linaro.org> (raw)
In-Reply-To: <1460729047-6346-7-git-send-email-andre.przywara@arm.com>
On 04/15/2016 04:04 PM, Andre Przywara wrote:
> 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>
> ---
> include/kvm/arm_arch_timer.h | 4 ++--
> virt/kvm/arm/arch_timer.c | 12 ++++++------
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
> index b651aed..1ed70f6 100644
> --- a/include/kvm/arm_arch_timer.h
> +++ b/include/kvm/arm_arch_timer.h
> @@ -53,8 +53,8 @@ struct arch_timer_cpu {
> /* Timer IRQ */
> struct kvm_irq_level irq;
>
> - /* VGIC mapping */
> - struct irq_phys_map *map;
> + /* The virtual IRQ number */
> + unsigned int virt_irq;
what's the difference between irq.irq and virt_irq? aren't they duplicates?
>
> /* Active IRQ state caching */
> bool active_cleared_last;
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index cfdf88f..1598e23 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -137,10 +137,10 @@ static void kvm_timer_update_irq(struct kvm_vcpu *vcpu, bool new_level)
>
> timer->active_cleared_last = false;
> timer->irq.level = new_level;
> - trace_kvm_timer_update_irq(vcpu->vcpu_id, timer->map->virt_irq,
> + trace_kvm_timer_update_irq(vcpu->vcpu_id, timer->virt_irq,
> timer->irq.level);
> ret = kvm_vgic_inject_mapped_irq(vcpu->kvm, vcpu->vcpu_id,
> - timer->map->virt_irq,
> + timer->virt_irq,
> timer->irq.level);
> WARN_ON(ret);
> }
> @@ -246,7 +246,7 @@ void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu)
> * to ensure that hardware interrupts from the timer triggers a guest
> * exit.
> */
> - if (timer->irq.level || kvm_vgic_map_is_active(vcpu, timer->map->virt_irq))
> + if (timer->irq.level || kvm_vgic_map_is_active(vcpu, timer->virt_irq))
> phys_active = true;
> else
> phys_active = false;
> @@ -351,7 +351,7 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
> if (WARN_ON(IS_ERR(map)))
> return PTR_ERR(map);
>
> - timer->map = map;
> + timer->virt_irq = irq->irq;
you also have a duplicate above:
timer->irq.irq = irq->irq;
> return 0;
> }
>
> @@ -494,8 +494,8 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu)
> struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu;
>
> timer_disarm(timer);
> - if (timer->map)
> - kvm_vgic_unmap_phys_irq(vcpu, timer->map->virt_irq);
> + if (timer->virt_irq)
> + kvm_vgic_unmap_phys_irq(vcpu, timer->virt_irq);
always unmap?
Cheers
Eric
> }
>
> void kvm_timer_enable(struct kvm *kvm)
>
next prev parent reply other threads:[~2016-04-21 17:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 14:04 [PATCH 0/7] KVM: arm/arm64: Rework arch timer IRQ interface Andre Przywara
2016-04-15 14:04 ` [PATCH 1/7] KVM: arm/arm64: remove unneeded map parameter for vgic_update_irq_pending() Andre Przywara
2016-04-21 17:08 ` Eric Auger
2016-04-15 14:04 ` [PATCH 2/7] KVM: arm/arm64: directly pass virtual IRQ number on injecting mapped IRQ Andre Przywara
2016-04-21 17:09 ` Eric Auger
2016-04-25 10:13 ` Andre Przywara
2016-04-15 14:04 ` [PATCH 3/7] KVM: arm/arm64: directly pass virtual IRQ number on kvm_vgic_map_is_active() Andre Przywara
2016-04-21 17:09 ` Eric Auger
2016-04-15 14:04 ` [PATCH 4/7] KVM: arm/arm64: directly pass virtual IRQ number on kvm_vgic_unmap_phys_irq() Andre Przywara
2016-04-21 17:41 ` Eric Auger
2016-04-15 14:04 ` [PATCH 5/7] KVM: arm/arm64: Remove the IRQ field from struct irq_phys_map Andre Przywara
2016-04-21 17:41 ` Eric Auger
2016-04-21 18:32 ` Christoffer Dall
2016-04-25 10:49 ` Andre Przywara
2016-04-25 10:25 ` Andre Przywara
2016-04-15 14:04 ` [PATCH 6/7] KVM: arm/arm64: remove irq_phys_map from the arch timer Andre Przywara
2016-04-21 17:56 ` Eric Auger [this message]
2016-04-25 10:29 ` Andre Przywara
2016-04-15 14:04 ` [PATCH 7/7] KVM: arm/arm64: remove irq_phys_map pointer from kvm_vgic_map_phys_irq() Andre Przywara
2016-04-21 18:04 ` Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57191433.40508@linaro.org \
--to=eric.auger@linaro$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox