From patchwork Thu Jul 9 08:22: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: 6754081 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 5080AC05AC for ; Thu, 9 Jul 2015 08:25:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F79E205E3 for ; Thu, 9 Jul 2015 08:25:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7D46205D8 for ; Thu, 9 Jul 2015 08:25:09 +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 1ZD77C-0004lH-IP; Thu, 09 Jul 2015 08:23:30 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZD76v-0004Pc-Na for linux-arm-kernel@lists.infradead.org; Thu, 09 Jul 2015 08:23:14 +0000 Received: by wiclp1 with SMTP id lp1so102330213wic.0 for ; Thu, 09 Jul 2015 01:22:49 -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=DR7ICSSgcG1uJ+WnmvOjlTYJBuyNXGqzGm2gwlHqI/0=; b=jB8Mqz6hvmcPBJW5uXLQLkidNMtKSyuBvLbJ6pc3jczn6quTL7yyw0Rar4VIJvwADP eq75HgKHYQPVmhg8YdnBueAsmLmc9BxoS9THbM1XGCPrVlXve3RYpTsUAzZkAd4RDdZt 8pB/arMLBbfpR5l2xnwv+Emggy7RpwsaMxPpQgEnYbK5dShnEy38FL9xO9BBD1EVHsuS CClgmNYRHQdIV83pP6bMtMiDkMGlAOkI78UzM3L2SypfkpGu82+4pxLJ/6qdMNuLxAKA +gEXtle7fxL+JRFDIuu0RaKL5ndJP0nbFktXpeAFdkuu22rgrQWljludLBMpe15332IR 2BrA== X-Gm-Message-State: ALoCoQkhLLYELJxGiompBuWHO0YpJqOfaN2H0++El+4UfcWRxq1Zz2pWQZKBRpVO7Y3qLU+oJDMF X-Received: by 10.180.78.136 with SMTP id b8mr114952963wix.44.1436430169253; Thu, 09 Jul 2015 01:22:49 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id ib9sm7522108wjb.2.2015.07.09.01.22.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:48 -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, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v2 3/7] KVM: irqchip: convey devid to kvm_set_msi Date: Thu, 9 Jul 2015 10:22:13 +0200 Message-Id: <1436430137-24205-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436430137-24205-1-git-send-email-eric.auger@linaro.org> References: <1436430137-24205-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150709_012313_929925_B1DD0F00 X-CRM114-Status: GOOD ( 14.03 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, pbonzini@redhat.com, p.fedin@samsung.com, patches@linaro.org 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.5 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 populated in kvm_msi struct in case the flag is set to KVM_MSI_VALID_DEVID. Let's populate the corresponding kvm_kernel_irq_routing_entry devid field and set the msi type to KVM_IRQ_ROUTING_EXTENDED_MSI. Signed-off-by: Eric Auger --- virt/kvm/irqchip.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 21c1424..e678f8a 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -72,9 +72,17 @@ 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; + if (msi->flags & KVM_MSI_VALID_DEVID) { + route.devid = msi->devid; + route.type = KVM_IRQ_ROUTING_EXTENDED_MSI; + } else if (!msi->flags) + return -EINVAL; + + /* historically the route.type was not set */ + route.msi.address_lo = msi->address_lo; route.msi.address_hi = msi->address_hi; route.msi.data = msi->data;