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: Auger Eric X-Patchwork-Id: 50426 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 51B90228D9 for ; Mon, 29 Jun 2015 15:37:59 +0000 (UTC) Received: by wibdu3 with SMTP id du3sf9644310wib.2 for ; Mon, 29 Jun 2015 08:37:58 -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=3RBueuDFbT9aHBwHN2r4q/JmhM/qREF6/ou18VAgNpk=; b=K4RlYk59d/twl6Zc9LNgVRWgAGo0n4nbJX8nFQp5N+zbrDGVT7YCEzWeR9+ZrLKfwt vpHG0DtGkk2kREt3izPw785HhVSb3nBO27jyUSJxvhoME/881sntCqEpPZO+lkL6aqYB 9sn2lKrFTXdHLR+qqdUuGWppHJUfGDLvdEl9xlKL7hVcGLLyEb/dO0pTb6/aBifgrvAI mOKpXvHGyG4e+7K0jLrZbXsyj3PRb44RsVzaNXTp9HOL1zP+I2Rpi+tVHxU4FfeyAYfA qi20L2fiyLbX3eeYt2N+jq5+1FDsVjmnT6jcVFPSzF/jhqUY6ayLeGBi+/go4uGTU8HH xaCw== X-Gm-Message-State: ALoCoQmDDKxpYKA91MkSvKiNb37Drjy5HC1HyOYg1prBKXMmmz1HXqPDRxneJAZ2OodssuVOIAam X-Received: by 10.112.122.12 with SMTP id lo12mr11183118lbb.5.1435592278555; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.40 with SMTP id kz8ls800538lab.24.gmail; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) X-Received: by 10.152.207.105 with SMTP id lv9mr14826701lac.10.1435592278285; Mon, 29 Jun 2015 08:37:58 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id 1si3536221lap.25.2015.06.29.08.37.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by lagh6 with SMTP id h6so58575934lag.2 for ; Mon, 29 Jun 2015 08:37:57 -0700 (PDT) X-Received: by 10.152.42.177 with SMTP id p17mr14668450lal.29.1435592277823; Mon, 29 Jun 2015 08:37:57 -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 hn6csp1790035lbb; Mon, 29 Jun 2015 08:37:57 -0700 (PDT) X-Received: by 10.194.71.135 with SMTP id v7mr28012832wju.83.1435592272086; Mon, 29 Jun 2015 08:37:52 -0700 (PDT) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com. [74.125.82.42]) by mx.google.com with ESMTPS id uv1si64732623wjc.80.2015.06.29.08.37.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.42 as permitted sender) client-ip=74.125.82.42; Received: by wguu7 with SMTP id u7so144737743wgu.3 for ; Mon, 29 Jun 2015 08:37:51 -0700 (PDT) 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org, p.fedin@samsung.com, pbonzini@redhat.com 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-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.45 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 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); }