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: Auger Eric X-Patchwork-Id: 50054 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 14753228CC for ; Thu, 18 Jun 2015 17:41:30 +0000 (UTC) Received: by wguu7 with SMTP id u7sf7045469wgu.0 for ; Thu, 18 Jun 2015 10:41:29 -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=mb/ufbHtdmfixxId9IuYXRF7CvF885MLZt7bUqqqAPE=; b=QWNC42tVFgXQYIhOprLGLtOd48DiXO10kG4uei6D8Gpz8pvtYbLGa6yOecCFueQ9+S XCJVfMZwJ7rvWQDcNc5CD6ZsFNHDlvdjMavpgd9opnT5lPk7DmBMUXyEhxHAGHA7NNtT oO+mIJAuobfbOP6XsyV0Y0abpfhdZUxDs1ZhufwqhP7cRaj7Y8Fbw5BexqaQHi27hkhN qIf6+BtQtsW0cVqlGnRboPiAp3CHcWnPro9Lwa2DV+I13liM0ZuwGR3I6JSOn3+NIayi 5PPuFQUL/HDj9HVbM5lChju39wpY3C2E78VfGdZRYLBgXibmwZvXEur+9/vHbFa6O/Kd 1eqg== X-Gm-Message-State: ALoCoQn2451Wm8y54wPCM+IQjx243kTjvJe5lkV5rmJNWxkLeH8vi+54vrJuz0gP3UzmTF0o6yJX X-Received: by 10.112.148.101 with SMTP id tr5mr11296667lbb.13.1434649289364; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.70 with SMTP id le6ls513554lac.50.gmail; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) X-Received: by 10.112.171.68 with SMTP id as4mr14043756lbc.64.1434649289224; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id w10si6895943law.138.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 patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labko7 with SMTP id ko7so59261344lab.2 for ; Thu, 18 Jun 2015 10:41:29 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr13790923lbb.76.1434649289153; Thu, 18 Jun 2015 10:41:29 -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 hn6csp11296lbb; Thu, 18 Jun 2015 10:41:28 -0700 (PDT) X-Received: by 10.194.205.101 with SMTP id lf5mr18088237wjc.37.1434649288492; Thu, 18 Jun 2015 10:41:28 -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 df3si16369753wib.53.2015.06.18.10.41.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:28 -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 wiga1 with SMTP id a1so728530wig.0 for ; Thu, 18 Jun 2015 10:41:28 -0700 (PDT) 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> 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.47 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: , 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; }