From patchwork Thu Jun 18 17:40:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D0728228CC for ; Thu, 18 Jun 2015 17:41:31 +0000 (UTC) Received: by lbbti3 with SMTP id ti3sf22423053lbb.1 for ; Thu, 18 Jun 2015 10:41:30 -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=NbD4+zFbT38s4S2mbDhn4YMFE0qe559X56fatW3Ylbo=; b=c5CPyqvtb/cjUA/Cm+FxL3AWjv7Ap/J9iVIkRXUgsFCoitSHPXQWHmg5+0cpn8/N1C WEfj2PS+HqIhdfQeJaum15A9+AIUm4GshKkmO/GG1RXn3qGS7WFGBAeV48fJgJ6xZ5gt 1hJL/9Cgw4qd3fFDpEDiLpLmolwWqN0mbrxjN9SaGCRGhBLa0hVUG92HQgcO7AWRy6+I UDMAasjJtKwqWXyDKslbEQy2o2H9W1fG6mnx9+RFKxhH3k0Jyq5ixiKpJfXXlXeBxexI Tk3s1AS81LCfrL5MLw9Sjnyo0IMX4z/7dK+WSHdDA6b7NsikaEjsj4s+IIPUAN7wGwZD u6TA== X-Gm-Message-State: ALoCoQmObk4qKls5Uc3LJ8/A7rmsWifSQb2hwMTv3q1aEXJ5GQV6TAwfqzOb4XFKxTduVBk+L7V8 X-Received: by 10.180.83.72 with SMTP id o8mr35851077wiy.3.1434649290791; Thu, 18 Jun 2015 10:41:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.201 with SMTP id t9ls485613laa.95.gmail; Thu, 18 Jun 2015 10:41:30 -0700 (PDT) X-Received: by 10.152.27.230 with SMTP id w6mr13705697lag.111.1434649290591; Thu, 18 Jun 2015 10:41:30 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id nx8si6895625lbb.161.2015.06.18.10.41.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labbc20 with SMTP id bc20so59142198lab.1 for ; Thu, 18 Jun 2015 10:41:30 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr13970517lbc.19.1434649290506; Thu, 18 Jun 2015 10:41:30 -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 hn6csp11313lbb; Thu, 18 Jun 2015 10:41:30 -0700 (PDT) X-Received: by 10.180.39.131 with SMTP id p3mr30817971wik.82.1434649289895; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com. [209.85.212.170]) by mx.google.com with ESMTPS id pg3si16380943wic.30.2015.06.18.10.41.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.170 as permitted sender) client-ip=209.85.212.170; Received: by wicnd19 with SMTP id nd19so29825559wic.1 for ; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) X-Received: by 10.180.215.101 with SMTP id oh5mr31148870wic.6.1434649289610; Thu, 18 Jun 2015 10:41:29 -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 bg6sm13222854wjc.13.2015.06.18.10.41.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:28 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, andre.przywara@arm.com, p.fedin@samsung.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: patches@linaro.org Subject: [RFC 6/6] KVM: arm: implement kvm_set_msi by gsi direct mapping Date: Thu, 18 Jun 2015 19:40:58 +0200 Message-Id: <1434649258-27065-7-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434649258-27065-1-git-send-email-eric.auger@linaro.org> References: <1434649258-27065-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.46 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 16d232f..40e96f9 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -2293,6 +2293,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; }