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: Auger Eric X-Patchwork-Id: 50921 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A8B5213FD for ; Thu, 9 Jul 2015 08:22:52 +0000 (UTC) Received: by lbko2 with SMTP id o2sf8030020lbk.0 for ; Thu, 09 Jul 2015 01:22: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: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=DR7ICSSgcG1uJ+WnmvOjlTYJBuyNXGqzGm2gwlHqI/0=; b=RK8XZpenqF071nNGR+87+EBP5UDc9aa+GoQUHsKLusjzp6+Cr6yspZDeb7UBOuhiWf usHCovPjV8gX25t3UL3Hz9hiIFzFIAfi2ttfd8K2ifdAqz4VJvMJ2RRlXLyrvVh0KIop 3Zp39yuhuG49e9mO4ViIGwrgF+am0d+IVgAGt864pKV97xi3PuhNylPYxqAeJj70ixRp VUo0UW69MsYw6GMDo+dZ0wnfu45cf2T/udVSYaXxeaG8sHiBEC+nYyywJqhtowKQYzMy iafb60AHMutVPtidPbYKwR98MtrPZoGlBhwcuhfQEvexgq3tkqacnq+z1q8S3Xf5AS9V m/xg== X-Gm-Message-State: ALoCoQmFZ18wLHDb10y5KPOWVXriQvXkvKerfnxKrCqBK+MKC/nL4GxNaq0FPCqngRZHk8NaDuK5 X-Received: by 10.181.13.202 with SMTP id fa10mr2121751wid.4.1436430171148; Thu, 09 Jul 2015 01:22:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.70 with SMTP id z6ls1077256lag.9.gmail; Thu, 09 Jul 2015 01:22:51 -0700 (PDT) X-Received: by 10.112.119.230 with SMTP id kx6mr13717904lbb.9.1436430170991; Thu, 09 Jul 2015 01:22:50 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id rc3si4154762lbb.143.2015.07.09.01.22.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laar3 with SMTP id r3so241772967laa.0 for ; Thu, 09 Jul 2015 01:22:50 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr13435049lbc.72.1436430170689; Thu, 09 Jul 2015 01:22:50 -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 hn6csp492405lbb; Thu, 9 Jul 2015 01:22:49 -0700 (PDT) X-Received: by 10.194.95.71 with SMTP id di7mr28499798wjb.125.1436430169513; Thu, 09 Jul 2015 01:22:49 -0700 (PDT) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com. [74.125.82.52]) by mx.google.com with ESMTPS id tm3si8448980wjc.126.2015.07.09.01.22.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:49 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52; Received: by wgjx7 with SMTP id x7so216373279wgj.2 for ; Thu, 09 Jul 2015 01:22:49 -0700 (PDT) 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 Cc: patches@linaro.org, andre.przywara@arm.com, p.fedin@samsung.com, pbonzini@redhat.com 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-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.44 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: , 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;