From: eric.auger@linaro•org (Eric Auger)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 4/7] KVM: arm/arm64: directly pass virtual IRQ number on kvm_vgic_unmap_phys_irq()
Date: Thu, 21 Apr 2016 19:41:10 +0200 [thread overview]
Message-ID: <571910B6.1030504@linaro.org> (raw)
In-Reply-To: <1460729047-6346-5-git-send-email-andre.przywara@arm.com>
Reviewed-by: Eric Auger <eric.auger@linaro•org>
Eric
On 04/15/2016 04:04 PM, Andre Przywara wrote:
> kvm_vgic_unmap_phys_irq() only needs the virtual IRQ number, so let's
> just pass that between the arch timer and the VGIC to get rid of
> the irq_phys_map pointer.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm•com>
> ---
> include/kvm/arm_vgic.h | 2 +-
> virt/kvm/arm/arch_timer.c | 2 +-
> virt/kvm/arm/vgic.c | 11 ++++-------
> 3 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
> index 5a34adc..43eeb18 100644
> --- a/include/kvm/arm_vgic.h
> +++ b/include/kvm/arm_vgic.h
> @@ -346,7 +346,7 @@ void vgic_v3_dispatch_sgi(struct kvm_vcpu *vcpu, u64 reg);
> int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu);
> struct irq_phys_map *kvm_vgic_map_phys_irq(struct kvm_vcpu *vcpu,
> int virt_irq, int irq);
> -int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, struct irq_phys_map *map);
> +int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, unsigned int virt_irq);
> bool kvm_vgic_map_is_active(struct kvm_vcpu *vcpu, unsigned int virt_irq);
>
> #define irqchip_in_kernel(k) (!!((k)->arch.vgic.in_kernel))
> diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c
> index 793465b..b4d96b1 100644
> --- a/virt/kvm/arm/arch_timer.c
> +++ b/virt/kvm/arm/arch_timer.c
> @@ -477,7 +477,7 @@ void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu)
>
> timer_disarm(timer);
> if (timer->map)
> - kvm_vgic_unmap_phys_irq(vcpu, timer->map);
> + kvm_vgic_unmap_phys_irq(vcpu, timer->map->virt_irq);
> }
>
> void kvm_timer_enable(struct kvm *kvm)
> diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
> index 6911327..2d7ae35 100644
> --- a/virt/kvm/arm/vgic.c
> +++ b/virt/kvm/arm/vgic.c
> @@ -1813,25 +1813,22 @@ static void vgic_free_phys_irq_map_rcu(struct rcu_head *rcu)
> /**
> * kvm_vgic_unmap_phys_irq - Remove a virtual to physical IRQ mapping
> * @vcpu: The VCPU pointer
> - * @map: The pointer to a mapping obtained through kvm_vgic_map_phys_irq
> + * @virt_irq: The virtual IRQ number to be unmapped
> *
> * Remove an existing mapping between virtual and physical interrupts.
> */
> -int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, struct irq_phys_map *map)
> +int kvm_vgic_unmap_phys_irq(struct kvm_vcpu *vcpu, unsigned int virt_irq)
> {
> struct vgic_dist *dist = &vcpu->kvm->arch.vgic;
> struct irq_phys_map_entry *entry;
> struct list_head *root;
>
> - if (!map)
> - return -EINVAL;
> -
> - root = vgic_get_irq_phys_map_list(vcpu, map->virt_irq);
> + root = vgic_get_irq_phys_map_list(vcpu, virt_irq);
>
> spin_lock(&dist->irq_phys_map_lock);
>
> list_for_each_entry(entry, root, entry) {
> - if (&entry->map == map) {
> + if (entry->map.virt_irq == virt_irq) {
> list_del_rcu(&entry->entry);
> call_rcu(&entry->rcu, vgic_free_phys_irq_map_rcu);
> break;
>
next prev parent reply other threads:[~2016-04-21 17:41 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 [this message]
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
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=571910B6.1030504@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