From patchwork Mon Aug 3 15:31:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6930571 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6651A9F402 for ; Mon, 3 Aug 2015 15:32:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8438E205D1 for ; Mon, 3 Aug 2015 15:32:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B66020627 for ; Mon, 3 Aug 2015 15:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752906AbbHCPc0 (ORCPT ); Mon, 3 Aug 2015 11:32:26 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:35318 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754084AbbHCPcZ (ORCPT ); Mon, 3 Aug 2015 11:32:25 -0400 Received: by wibxm9 with SMTP id xm9so126976120wib.0 for ; Mon, 03 Aug 2015 08:32:23 -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=MQywBrk5rpmkpwxVfoAIRUXy1aftraXnI/i3wBZ+QNc=; b=ip5xRMmfCGiTW+S6bjK7/vZ21Gd/UeQZMsb1ccFnyyAsQ63eKzPBuAXZVhuX3rDzOJ rHSVsbLruV4sXgoA0FIUcxVyAOGDoK+bAXiB06qdGt0KdgVBGX5LUTyPQO8Bf1mcUCYQ 2Ak67iILYkHZqYRvx1ljYXTqjS8wAgNqRBQTkL4FBTW0CiexUpMiCehMKEMGDAb22eg4 EmBtZqm/QiH0hdd/MQJZ/X2luz9cXe0vSP23ZqSqTaaBgHLQA8eRmMtr3VbCSHHf/XF4 69h9Wd9DU2yB3b4fcQCNiC/O/J+sg766ZO4H5rUripQC3KLYly35WJCjfuXupsqQXXTv p3nQ== X-Gm-Message-State: ALoCoQkaR1MvkJkJGChuXcZpo5l+RmLwcsdPfO8Q1j4vRxR8mN5uglu1rYeteAZ/2SVCeTvNq2Fv X-Received: by 10.180.230.199 with SMTP id ta7mr14417973wic.1.1438615943544; Mon, 03 Aug 2015 08:32:23 -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 ny7sm14134420wic.11.2015.08.03.08.32.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 08:32:22 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com, andre.przywara@arm.com, p.fedin@samsung.com Subject: [PATCH v3 3/7] KVM: irqchip: convey devid to kvm_set_msi Date: Mon, 3 Aug 2015 17:31:25 +0200 Message-Id: <1438615889-10892-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438615889-10892-1-git-send-email-eric.auger@linaro.org> References: <1438615889-10892-1-git-send-email-eric.auger@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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(-) diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c index 21c1424..75c9931 100644 --- a/virt/kvm/irqchip.c +++ b/virt/kvm/irqchip.c @@ -72,12 +72,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); }