From patchwork Mon Jun 29 15:37:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6689851 Return-Path: X-Original-To: patchwork-linux-arm@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 BBC0AC05AC for ; Mon, 29 Jun 2015 15:44:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA46420462 for ; Mon, 29 Jun 2015 15:44:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 090102045B for ; Mon, 29 Jun 2015 15:44:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9bAe-0005wc-GB; Mon, 29 Jun 2015 15:40:32 +0000 Received: from mail-wg0-f54.google.com ([74.125.82.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9b8P-0003RW-JY for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2015 15:38:14 +0000 Received: by wgck11 with SMTP id k11so144883852wgc.0 for ; Mon, 29 Jun 2015 08:37:51 -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=3RBueuDFbT9aHBwHN2r4q/JmhM/qREF6/ou18VAgNpk=; b=CAld8B5dTvU1KRT5ealMtF018CCp0LIcqCdpE0AsZZLiBx9QVliXixy5K/4zlHsw+U 8QMiqwyJQBzgL/b5vbO0WO8ZJ8JJq51xMp8vNqm4HpW6XS0GmLCErg5Oa5ZtXc3w328o vaBV6UG5rmSAYvTRDs9AowFrWhsZDaTCGwpxkLMoNBllDNw1OHl6VsUVlWqp18zbe2VL b2lMlXfM/TDCe1Iv9pMptM3kN68UvGo6kTnj0IUur9/V1owZGYmu/u7jCBLoYRkzvI7G MKskFFL/MIicG/US2ezMmojC2HXGph7c7rzKNqbL88N1gl4f6OMg74AwdzLOSysksVAf ecRw== X-Gm-Message-State: ALoCoQnL7abR3Ys0j8bKIHdn8koappK7XAkrZmh9v0FNjrZxUQ6K/mB+NOygt56XW7tjfC3S3y00 X-Received: by 10.180.149.240 with SMTP id ud16mr23562181wib.7.1435592271625; Mon, 29 Jun 2015 08:37:51 -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.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:50 -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 Subject: [PATCH 3/7] KVM: irqchip: convey devid to kvm_set_msi Date: Mon, 29 Jun 2015 17:37:13 +0200 Message-Id: <1435592237-17924-4-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150629_083813_832097_238D1F4E X-CRM114-Status: GOOD ( 12.96 ) X-Spam-Score: -2.6 (--) Cc: pbonzini@redhat.com, p.fedin@samsung.com, linux-kernel@vger.kernel.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 on ARM, a devid field is conveyed in kvm_msi struct. Let's choose the routing type and struct according to its availability and fill the corresponding struct. Also remove the flag check now this latter can be non null. Signed-off-by: Eric Auger --- virt/kvm/irqchip.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 1d56a90..e76c7d2 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -73,12 +73,22 @@ int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi) { struct kvm_kernel_irq_routing_entry route; - if (!irqchip_in_kernel(kvm) || msi->flags != 0) + if (!irqchip_in_kernel(kvm)) return -EINVAL; - route.msi.address_lo = msi->address_lo; - route.msi.address_hi = msi->address_hi; - route.msi.data = msi->data; + if (msi->flags & KVM_MSI_VALID_DEVID) { + route.type = KVM_IRQ_ROUTING_EXTENDED_MSI; + route.ext_msi.address_lo = msi->address_lo; + route.ext_msi.address_hi = msi->address_hi; + route.ext_msi.data = msi->data; + route.ext_msi.devid= msi->devid; + } + else { + route.type = KVM_IRQ_ROUTING_MSI; + route.msi.address_lo = msi->address_lo; + route.msi.address_hi = msi->address_hi; + route.msi.data = msi->data; + } return kvm_set_msi(&route, kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1, false); }