From patchwork Thu Jun 18 17:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6639581 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 CCA78C0433 for ; Thu, 18 Jun 2015 17:41:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD2C02084A for ; Thu, 18 Jun 2015 17:41:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDD7D2062D for ; Thu, 18 Jun 2015 17:41:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753973AbbFRRlf (ORCPT ); Thu, 18 Jun 2015 13:41:35 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:33542 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbbFRRl3 (ORCPT ); Thu, 18 Jun 2015 13:41:29 -0400 Received: by wgez8 with SMTP id z8so69927951wge.0 for ; Thu, 18 Jun 2015 10:41:28 -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=mb/ufbHtdmfixxId9IuYXRF7CvF885MLZt7bUqqqAPE=; b=QGGAVmOwReESd/vKoDOZKUQYorLATjABnUJyZL3rywpju8p19xhNfDvKuoTC3T9FSd F5nYzTGZtH6togoxACNxIm8cYrC67FCqkvs/73hXz+xrxNAUMVYuwriiMB7JZrZSVPgi /45uD1MMwzgW4Js+15QaEXAD4D3YeN1ZGwWY6eZz9HsYMhYihO2SlRbp8GPTd4JwnMM0 nI4seAHXnXJSF3llk1N/Byce/92TRE30OyKsTh+1LEwXURRxBnn5qUNWrLIr3dH0PBdR +FFuVvnlAVBJNzkvXj7vTmN9+n6HJ4qnd++LlMDD379i3QKSGecI1oGWknl3p8sPEDaW 1DOA== X-Gm-Message-State: ALoCoQmF9UyXeLpkH4SJMrRUXv7vK2AXBcWBHs0SvvvJrJKu9XJa7g4EAXWCkZARkfr0WyD3gLlk X-Received: by 10.180.9.7 with SMTP id v7mr30314699wia.60.1434649288267; Thu, 18 Jun 2015 10:41:28 -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.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:27 -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 5/6] KVM: arm/arm64: enable MSI routing Date: Thu, 18 Jun 2015 19:40:57 +0200 Message-Id: <1434649258-27065-6-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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.2 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 Up to now, only irqchip routing entries could be set. This patch adds the capability to insert MSI routing entries, extended or standard ones. Although standard MSI entries can be set, their injection still is not supported. For ARM64, let's also increase KVM_MAX_IRQ_ROUTES to 4096. Signed-off-by: Eric Auger --- include/linux/kvm_host.h | 2 ++ virt/kvm/arm/vgic.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index e1c1c0d..6cacf11 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -927,6 +927,8 @@ static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq) #ifdef CONFIG_S390 #define KVM_MAX_IRQ_ROUTES 4096 //FIXME: we can have more than that... +#elif defined(CONFIG_ARM64) +#define KVM_MAX_IRQ_ROUTES 4096 //FIXME: we can have more than that too... #else #define KVM_MAX_IRQ_ROUTES 1024 #endif diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 212a5ff..16d232f 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -2256,6 +2256,19 @@ int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e, (e->irqchip.irqchip >= KVM_NR_IRQCHIPS)) goto out; break; + case KVM_IRQ_ROUTING_MSI: + e->set = kvm_set_msi; + e->msi.address_lo = ue->u.msi.address_lo; + e->msi.address_hi = ue->u.msi.address_hi; + e->msi.data = ue->u.msi.data; + break; + case KVM_IRQ_ROUTING_EXTENDED_MSI: + e->set = kvm_set_msi; + e->ext_msi.address_lo = ue->u.ext_msi.address_lo; + e->ext_msi.address_hi = ue->u.ext_msi.address_hi; + e->ext_msi.data = ue->u.ext_msi.data; + e->ext_msi.devid = ue->u.ext_msi.devid; + break; default: goto out; }