From patchwork Mon Jun 29 15:37:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50431 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89F88228D9 for ; Mon, 29 Jun 2015 15:38:13 +0000 (UTC) Received: by lagx9 with SMTP id x9sf20603337lag.2 for ; Mon, 29 Jun 2015 08:38:12 -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=5cELHofA162vm3H+FfecxEueHZ38WqzmhavRphIQzNo=; b=F1IB5SS7k+WZPIFvJgATYj6ZPCl81jAe2Gmw9eNe8WZX818IvgHBhC7VacDOstq7Op 6cYkzikhnKTmv5JHk9MK+mVPsfEVzOeF3qqBerqoG5rfzU30XkHjL6X/x2Gp6uSTYwIY C3xzXqWj2ZumZ4ljrnIenqgcIMBtazwlFPSuZlstvrrs411K+li9+snoRDlb/+3a7zVg laNhr+3Eb8qJZsRjTBvzaeg0UciUx89FH/92+hILasavohA7DbodA4O8BOE0AwtbJ/xA ij5OQKFPbkpQF0mWC0dmmDHi6oOeWCmGd43RDzlunQSpyP7EJiLga3zBYTQvBFOQfJL9 8HBA== X-Gm-Message-State: ALoCoQn2dJWsynhjAF74ziE/xHAaWZbKUGDU3rEpUzrLEN2lCbiIyYbrYB20Sc7gtHPb59xhoT02 X-Received: by 10.112.9.100 with SMTP id y4mr11273845lba.20.1435592292463; Mon, 29 Jun 2015 08:38:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.6 with SMTP id lc6ls793802lac.80.gmail; Mon, 29 Jun 2015 08:38:12 -0700 (PDT) X-Received: by 10.112.162.38 with SMTP id xx6mr14759850lbb.110.1435592292195; Mon, 29 Jun 2015 08:38:12 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id y2si7621014lbp.38.2015.06.29.08.38.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:38:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by laar3 with SMTP id r3so68409913laa.0 for ; Mon, 29 Jun 2015 08:38:12 -0700 (PDT) X-Received: by 10.152.42.177 with SMTP id p17mr14669530lal.29.1435592292101; Mon, 29 Jun 2015 08:38:12 -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.108.230 with SMTP id hn6csp1790197lbb; Mon, 29 Jun 2015 08:38:11 -0700 (PDT) X-Received: by 10.194.206.65 with SMTP id lm1mr30056467wjc.117.1435592278676; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com. [209.85.212.182]) by mx.google.com with ESMTPS id dd10si13752406wib.30.2015.06.29.08.37.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.182 as permitted sender) client-ip=209.85.212.182; Received: by wiar9 with SMTP id r9so8131084wia.1 for ; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) X-Received: by 10.180.82.162 with SMTP id j2mr24556879wiy.54.1435592278536; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id lf4sm64675965wjb.42.2015.06.29.08.37.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:57 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, christoffer.dall@linaro.org, andre.przywara@arm.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, patches@linaro.org, p.fedin@samsung.com, pbonzini@redhat.com Subject: [PATCH 7/7] KVM: arm: implement kvm_set_msi by gsi direct mapping Date: Mon, 29 Jun 2015 17:37:17 +0200 Message-Id: <1435592237-17924-8-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435592237-17924-1-git-send-email-eric.auger@linaro.org> References: <1435592237-17924-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.49 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: , If the ITS modality is not available, let's simply support MSI injection by transforming the MSI.data into an SPI ID. This becomes possible to use KVM_SIGNAL_MSI ioctl for arm too. Signed-off-by: Eric Auger --- arch/arm/kvm/Kconfig | 1 + virt/kvm/arm/vgic.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index 151e710..0f58baf 100644 --- a/arch/arm/kvm/Kconfig +++ b/arch/arm/kvm/Kconfig @@ -31,6 +31,7 @@ config KVM select KVM_VFIO select HAVE_KVM_EVENTFD select HAVE_KVM_IRQFD + select HAVE_KVM_MSI select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQ_ROUTING depends on ARM_VIRT_EXT && ARM_LPAE && ARM_ARCH_TIMER diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 0b4c48c..b3c10dc 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -2314,6 +2314,11 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, return kvm->arch.vgic.vm_ops.inject_msi(kvm, &msi); else return -ENODEV; + case KVM_IRQ_ROUTING_MSI: + if (kvm->arch.vgic.vm_ops.inject_msi) + return -EINVAL; + else + return kvm_vgic_inject_irq(kvm, 0, e->msi.data, level); default: return -EINVAL; }