From patchwork Mon Apr 4 08:47:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 64974 Delivered-To: patches@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1064247lbc; Mon, 4 Apr 2016 01:49:02 -0700 (PDT) X-Received: by 10.25.161.17 with SMTP id k17mr884928lfe.61.1459759742745; Mon, 04 Apr 2016 01:49:02 -0700 (PDT) Return-Path: Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com. [2a00:1450:4010:c04::229]) by mx.google.com with ESMTPS id qo10si15307302lbb.210.2016.04.04.01.49.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Apr 2016 01:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) client-ip=2a00:1450:4010:c04::229; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:4010:c04::229 as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lb0-x229.google.com with SMTP id u8so150007187lbk.0 for ; Mon, 04 Apr 2016 01:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oNv2OT35m6cdl/81bJPeraMRwAVya0MIoxyykgTu4bg=; b=QreKcArxC8tNIorXlxP1d6XOp0qYZ8NxUMNp/L3ZAs14jOU4AFx5W/RZ9wPpKzO+GY ZLrKUEbG83Q2GGAJ7TyGOsLAbcjKOVMMvSgol06ywUEYsf/hQGZk/ZPgP0rUjLphAig7 Ol/UM8S57TCBsCeRRV2vmzO2IVX3J7RXplfuQ= 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=oNv2OT35m6cdl/81bJPeraMRwAVya0MIoxyykgTu4bg=; b=Bt7SKZorW4HhVe3O+5zaVmpfiqRbpFJeZBTwy24R8cOzRAFvlWhVMWArR/Mi7lTmTo cm+rdjYRgEEvuIDw03hUV3jfTmaSkWXQrCkgY/MeuYIJN4OVe/aKGaIp0ia9/K0wSU3o s+6I5eHArJbhA/bzUGsf/1TLpAkFOMROon5nTo4Eg17JM3H2x8xesM52YGLyCsE1vpbp X4AdhYx3TJniMRUT3lxfXqq4fkT5TcLSVhB6w2arkZt8w5XNWC7tv5x9Vi07Ju0U7ROf IT2X/1zLWA+XHYycdg24c59117PkBvmRwK9w7HEN7in4PbhdNh3j8zQwVsdMIAq6oVyC RoQQ== X-Gm-Message-State: AD7BkJLdgChWoCcgVuIC9rSVjctVIv2cUwMkIWAk4NqtTZZh0wM1VM4siDsg1hK7w2jOHDWv8YQ= X-Received: by 10.28.4.195 with SMTP id 186mr10570702wme.45.1459759742289; Mon, 04 Apr 2016 01:49:02 -0700 (PDT) Return-Path: Received: from gnx2579.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id kj9sm27921384wjb.14.2016.04.04.01.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Apr 2016 01:49:00 -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, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: patches@linaro.org, pbonzini@redhat.com, p.fedin@samsung.com, Manish.Jaggi@caviumnetworks.com Subject: [PATCH v4 3/7] KVM: irqchip: convey devid to kvm_set_msi Date: Mon, 4 Apr 2016 10:47:33 +0200 Message-Id: <1459759657-7402-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459759657-7402-1-git-send-email-eric.auger@linaro.org> References: <1459759657-7402-1-git-send-email-eric.auger@linaro.org> on ARM, a devid field is populated in kvm_msi struct in case the flag is set to KVM_MSI_VALID_DEVID. Let's propagate both flags and devid field in kvm_kernel_irq_routing_entry. Signed-off-by: Eric Auger --- v2 -> v3: - do not set the type to KVM_IRQ_ROUTING_EXTENDED_MSI anymore as suggested by Andre - correct msi->flags check - propagate the flags --- virt/kvm/irqchip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.9.1 Acked-by: Christoffer Dall diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index fe84e1a..1c556cb 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -62,12 +62,14 @@ 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) || (msi->flags & ~KVM_MSI_VALID_DEVID)) return -EINVAL; route.msi.address_lo = msi->address_lo; route.msi.address_hi = msi->address_hi; route.msi.data = msi->data; + route.flags = msi->flags; + route.devid = msi->devid; return kvm_set_msi(&route, kvm, KVM_USERSPACE_IRQ_SOURCE_ID, 1, false); }