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: Eric Auger X-Patchwork-Id: 6689751 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5605EC05AC for ; Mon, 29 Jun 2015 15:40:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75B37202E6 for ; Mon, 29 Jun 2015 15:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F3CC202BE for ; Mon, 29 Jun 2015 15:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753367AbbF2PjB (ORCPT ); Mon, 29 Jun 2015 11:39:01 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:33331 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753340AbbF2PiA (ORCPT ); Mon, 29 Jun 2015 11:38:00 -0400 Received: by wgck11 with SMTP id k11so144886615wgc.0 for ; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5cELHofA162vm3H+FfecxEueHZ38WqzmhavRphIQzNo=; b=ljCtzZ4mlO5811yiemnJvHz7NIch8KAMif6dIoxdaL9tpDNV/LjZbOOtAvRbFrDPNW gax7kCyvdCyCG3GRI5Yk3oxKLJQI1zuJ9qo9DSfz/f/byKqK7VK/mHO6jHQgqyJ4Imfm Oq7ELEjA5lgYXAQIhf9T22TRP0qRbFEZz2bOS49fiCFKUBD9kLOLlMM7GJ+jBT+szKFC /tv3tZpTR39BQ7HcTW9k/9TIUGHhPOyOtMwKdHj/7hTs8jOaIH4x7yRSeoymh765LSYi ZK6SYIiz6tYmTglPbb1t+njM3wvQ1g0vR/euJXsi/rverRQXlnkf5mFV9V0BJVnqzkmh 3rXA== X-Gm-Message-State: ALoCoQlNE4hrDWwpNdpVtM5GvAyugXnugJxXZ5bu2YXVnmvr3b2MV7RiDyIsCV+Wh8oUp18+suts 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }