Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161021AbbKSO5N (ORCPT ); Thu, 19 Nov 2015 09:57:13 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:35320 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758760AbbKSOy0 (ORCPT ); Thu, 19 Nov 2015 09:54:26 -0500 From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, alex.williamson@redhat.com, b.reynal@virtualopensystems.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH v4 09/13] KVM: arm/arm64: vgic: support irqfd injection of a mapped IRQ Date: Thu, 19 Nov 2015 14:53:59 +0000 Message-Id: <1447944843-17731-10-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447944843-17731-1-git-send-email-eric.auger@linaro.org> References: <1447944843-17731-1-git-send-email-eric.auger@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1396 Lines: 43 Up to now irqfd injection was only possible for unmapped IRQ. This patch adds support for injecting mapped interrupts. Signed-off-by: Eric Auger --- virt/kvm/arm/vgic.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index dba8eb6..e96f79e 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -2476,13 +2476,21 @@ 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 vgic_dist *dist = &kvm->arch.vgic; unsigned int spi = irq + VGIC_NR_PRIVATE_IRQS; + struct irq_phys_map *map; + int vcpu_id; trace_kvm_set_irq(irq, level, irq_source_id); BUG_ON(!vgic_initialized(kvm)); - return kvm_vgic_inject_irq(kvm, 0, spi, level); + vcpu_id = dist->irq_spi_cpu[irq]; + map = vgic_irq_map_search(kvm_get_vcpu(kvm, vcpu_id), spi); + if (!map) + return kvm_vgic_inject_irq(kvm, vcpu_id, spi, level); + else + return kvm_vgic_inject_mapped_irq(kvm, vcpu_id, map, level); } /* MSI not implemented yet */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/