From patchwork Mon Aug 10 13:21:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 52242 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 43FED22919 for ; Mon, 10 Aug 2015 13:22:15 +0000 (UTC) Received: by labd1 with SMTP id d1sf17605860lab.0 for ; Mon, 10 Aug 2015 06:22:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=CY6Z5LELsKVuEzL/pEVYpNG46ENRzD1Eo1oFMX7wMeQ=; b=KLku092DrnlcfaC4aHWSBLAhzryncpMllHj2XCsjU1kKvwb/lfY3UH2aToNmDqt/AR V4NwjYP11wxMPbwHH28MOhh/hxDNI190G5zFaY9YHHSxZu0M/PptfutSdjWL+f8vDHeQ Onr/zzVM4WJTbZDgjQ01Yv3gYhNzCi+wwYx055buCp16eVOBImvG5JRMxkK3YP7OjXUi eoog1eCSQYHaa7AHAmvskJJuRHd2WsU1219sXaHEzRTws7GIDx4cgcnjtrBat67wqbz+ Id+p3Fva50jdikNAaN+Rw9i4la+bK46lRu+8WiZWEryhyD0of/ec107rYiQjpJZNINYF 1HCw== X-Gm-Message-State: ALoCoQmQnCPcbROIAyKBGsVx/5tUXTSswBgL/uAAL/XsxnEqC27OyDSpxz+JZpVddjkvvpHW8HWG X-Received: by 10.112.13.200 with SMTP id j8mr6421954lbc.14.1439212934225; Mon, 10 Aug 2015 06:22:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.1 with SMTP id g1ls660033lag.46.gmail; Mon, 10 Aug 2015 06:22:14 -0700 (PDT) X-Received: by 10.152.163.35 with SMTP id yf3mr5234480lab.84.1439212934078; Mon, 10 Aug 2015 06:22:14 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ef7si14031799lbb.44.2015.08.10.06.22.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:22:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labd1 with SMTP id d1so39834411lab.1 for ; Mon, 10 Aug 2015 06:22:14 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr20344167lbb.56.1439212933998; Mon, 10 Aug 2015 06:22:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1931835lba; Mon, 10 Aug 2015 06:22:13 -0700 (PDT) X-Received: by 10.194.83.70 with SMTP id o6mr43651628wjy.44.1439212925307; Mon, 10 Aug 2015 06:22:05 -0700 (PDT) Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com. [209.85.212.180]) by mx.google.com with ESMTPS id fx5si16038913wic.104.2015.08.10.06.22.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.180 as permitted sender) client-ip=209.85.212.180; Received: by wicne3 with SMTP id ne3so135772864wic.1 for ; Mon, 10 Aug 2015 06:22:05 -0700 (PDT) X-Received: by 10.194.5.103 with SMTP id r7mr42570886wjr.47.1439212924948; Mon, 10 Aug 2015 06:22:04 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id fq15sm29517024wjc.12.2015.08.10.06.22.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:22:04 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.williamson@redhat.com, feng.wu@intel.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 08/10] KVM: arm/arm64: vgic: support irqfd injection of a forwarded IRQ Date: Mon, 10 Aug 2015 15:21:02 +0200 Message-Id: <1439212864-12954-9-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439212864-12954-1-git-send-email-eric.auger@linaro.org> References: <1439212864-12954-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 */