lkml.org 
[lkml]   [2015]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 08/10] KVM: arm/arm64: vgic: support irqfd injection of a forwarded IRQ
Date
Currently irqfd injection relies on kvm_vgic_inject_irq function.
However this function cannot be used anymore for mapped IRQs. So
let's change the implementation to use kvm_vgic_inject_mapped_irq
when the IRQ is forwarded.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
virt/kvm/arm/vgic.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index fbd5ba5..03a85b3 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -2529,13 +2529,19 @@ int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned irqchip, unsigned pin)
int kvm_set_irq(struct kvm *kvm, int irq_source_id,
u32 irq, int level, bool line_status)
{
+ struct irq_phys_map *map;
unsigned int spi = irq + VGIC_NR_PRIVATE_IRQS;

trace_kvm_set_irq(irq, level, irq_source_id);

BUG_ON(!vgic_initialized(kvm));

- return kvm_vgic_inject_irq(kvm, 0, spi, level);
+ map = vgic_irq_map_search(kvm_get_vcpu(kvm, 0), spi);
+
+ if (!map)
+ return kvm_vgic_inject_irq(kvm, 0, spi, level);
+ else
+ return kvm_vgic_inject_mapped_irq(kvm, 0, map, level);
}

/* MSI not implemented yet */
--
1.9.1


\
 
 \ /
  Last update: 2015-08-10 15:41    [W:0.118 / U:1.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site