From patchwork Thu Jun 18 17:40:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50052 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 602BD228CC for ; Thu, 18 Jun 2015 17:41:26 +0000 (UTC) Received: by wguu7 with SMTP id u7sf7045095wgu.0 for ; Thu, 18 Jun 2015 10:41:25 -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=CoPuawXaWSaFV3008OlnOSURixSnR4VR5O6860th0uE=; b=ezXHZH0lvMsmMHbF1gBcvJvD6IlKDJT2+P8fW8uOHif2YZwH1JS588qxzUemaQF5rE S0q29KuRr0gPOMjPrgzc8Uwd9SeMK2J0aZDFH4F67tsPV7XIqocqOdDyS3/dggYxoDBI UeIj2pGg5gV7XAKOrj7Kpsw+2xQbNr3yw8RHkB6s0K2G4gPsc5tcTHTdUX4G/WkJrY7J NBJxoU5rYAT2InMk7MFbSRUv3vtostR4lt2dH6dKtg9M6BRcXbIkwt6GxkpqP+vrZWk3 JkCewFv2LbtDiI0d1NIR+SW0ymlUjPoojLF+Eosy5GU274DIUYkow77bg88LqUD13ddL M57Q== X-Gm-Message-State: ALoCoQkbzJfERUuNNfsbqF2P6ms2cCivv7SVC+806InJaNpj2OCY2hUzOW0hQ5myRfjxnH1i5iuK X-Received: by 10.180.216.12 with SMTP id om12mr14045392wic.1.1434649285715; Thu, 18 Jun 2015 10:41:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.8.171 with SMTP id dl11ls468851lad.55.gmail; Thu, 18 Jun 2015 10:41:25 -0700 (PDT) X-Received: by 10.112.119.198 with SMTP id kw6mr13603941lbb.97.1434649285559; Thu, 18 Jun 2015 10:41:25 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id u7si6910700laj.60.2015.06.18.10.41.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labko7 with SMTP id ko7so59260379lab.2 for ; Thu, 18 Jun 2015 10:41:25 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr13780446lbc.112.1434649285468; Thu, 18 Jun 2015 10:41:25 -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 hn6csp11273lbb; Thu, 18 Jun 2015 10:41:25 -0700 (PDT) X-Received: by 10.194.192.33 with SMTP id hd1mr7530372wjc.96.1434649284878; Thu, 18 Jun 2015 10:41:24 -0700 (PDT) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com. [209.85.212.175]) by mx.google.com with ESMTPS id s11si15088113wju.161.2015.06.18.10.41.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.175 as permitted sender) client-ip=209.85.212.175; Received: by wibdq8 with SMTP id dq8so702101wib.1 for ; Thu, 18 Jun 2015 10:41:24 -0700 (PDT) X-Received: by 10.180.103.194 with SMTP id fy2mr31167045wib.55.1434649284594; Thu, 18 Jun 2015 10:41:24 -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 bg6sm13222854wjc.13.2015.06.18.10.41.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 10:41:23 -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, p.fedin@samsung.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: patches@linaro.org Subject: [RFC 3/6] KVM: irqchip: convey devid to kvm_set_msi Date: Thu, 18 Jun 2015 19:40:55 +0200 Message-Id: <1434649258-27065-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434649258-27065-1-git-send-email-eric.auger@linaro.org> References: <1434649258-27065-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.53 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 rooting 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); }