From patchwork Thu Jul 9 08:22:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 50919 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 117E6213FD for ; Thu, 9 Jul 2015 08:22:47 +0000 (UTC) Received: by wgwk7 with SMTP id k7sf21884420wgw.0 for ; Thu, 09 Jul 2015 01:22:46 -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=fBxEhycXEYoi+ImYb/RxYok5HoH0jEpraYoIjFwoysc=; b=EJWu7th317xom83ZiZrebAvTN0gGzMKg2mXhEkFdQEq/RUmXA1eZARv/Y3Cxi8DiI0 1QIEdIMOhFd2gyazulAWkR8EdTvxlYtQq/6Q6nDDC04S8G7ntqb1L4mgE1uxn5h5+XZU fds0rz2EBLOlKZrczcvOX5gRpsnAdGNusqvev8TJy1Az5WNkbxQ5Tj7u30BDMu3PuuqL 6BncBCjXn/N34G+v6seg+smvmi12us2DGOTkniE0IQUq/HjoAXk7FMrhCa+OafnpfSdt iN24LlbqoOeGlZrn14H78nUp8o5jJGj7WjCRWd6XueQHSQgMwHwTQ7HvfSv5b/8dpA6e HCdA== X-Gm-Message-State: ALoCoQmo3XGtQpMsq4d71lG7Qo5/aHNXRsA3ADCvAmS9DEFGCR9UuUyrtANqAmteasVLeAr+1Ury X-Received: by 10.112.142.67 with SMTP id ru3mr7182203lbb.1.1436430166214; Thu, 09 Jul 2015 01:22:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.65 with SMTP id yg1ls965709lab.26.gmail; Thu, 09 Jul 2015 01:22:46 -0700 (PDT) X-Received: by 10.112.46.9 with SMTP id r9mr249309lbm.53.1436430166070; Thu, 09 Jul 2015 01:22:46 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id ls6si3869557lac.31.2015.07.09.01.22.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lblf12 with SMTP id f12so1017011lbl.2 for ; Thu, 09 Jul 2015 01:22:46 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr13546772lag.86.1436430165969; Thu, 09 Jul 2015 01:22:45 -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 hn6csp492357lbb; Thu, 9 Jul 2015 01:22:45 -0700 (PDT) X-Received: by 10.194.57.170 with SMTP id j10mr27259065wjq.140.1436430165360; Thu, 09 Jul 2015 01:22:45 -0700 (PDT) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com. [74.125.82.44]) by mx.google.com with ESMTPS id ht7si8425818wjb.176.2015.07.09.01.22.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 74.125.82.44 as permitted sender) client-ip=74.125.82.44; Received: by wgck11 with SMTP id k11so216728837wgc.0 for ; Thu, 09 Jul 2015 01:22:45 -0700 (PDT) X-Received: by 10.194.2.137 with SMTP id 9mr28153185wju.75.1436430165050; Thu, 09 Jul 2015 01:22:45 -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.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 01:22:44 -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 1/7] KVM: api: introduce KVM_IRQ_ROUTING_EXTENDED_MSI Date: Thu, 9 Jul 2015 10:22:11 +0200 Message-Id: <1436430137-24205-2-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.217.172 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, the MSI msg (address and data) comes along with out-of-band device ID information. The device ID encodes the device that writes the MSI msg. Let's convey the device id in kvm_irq_routing_msi and use a new routing entry type to indicate the devid is populated. Signed-off-by: Eric Auger --- v1 -> v2: - devid id passed in kvm_irq_routing_msi instead of in kvm_irq_routing_entry RFC -> PATCH - remove kvm_irq_routing_extended_msi and use union instead --- Documentation/virtual/kvm/api.txt | 10 +++++++++- include/uapi/linux/kvm.h | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index bea8de7..3d920cd 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1453,6 +1453,7 @@ struct kvm_irq_routing_entry { #define KVM_IRQ_ROUTING_IRQCHIP 1 #define KVM_IRQ_ROUTING_MSI 2 #define KVM_IRQ_ROUTING_S390_ADAPTER 3 +#define KVM_IRQ_ROUTING_EXTENDED_MSI 4 No flags are specified so far, the corresponding field must be set to zero. @@ -1465,9 +1466,16 @@ struct kvm_irq_routing_msi { __u32 address_lo; __u32 address_hi; __u32 data; - __u32 pad; + union { + __u32 pad; + __u32 devid; + }; }; +for KVM_IRQ_ROUTING_EXTENDED_MSI routing entry type, the kvm_irq_routing_msi +routing entry is used and devid is populated with the device ID that wrote +the MSI message. For PCI, this is usually a BFD identifier in the lower 16 bits. + struct kvm_irq_routing_s390_adapter { __u64 ind_addr; __u64 summary_addr; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 9a261e5..39ec164 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -829,7 +829,10 @@ struct kvm_irq_routing_msi { __u32 address_lo; __u32 address_hi; __u32 data; - __u32 pad; + union { + __u32 pad; + __u32 devid; + }; }; struct kvm_irq_routing_s390_adapter { @@ -844,6 +847,7 @@ struct kvm_irq_routing_s390_adapter { #define KVM_IRQ_ROUTING_IRQCHIP 1 #define KVM_IRQ_ROUTING_MSI 2 #define KVM_IRQ_ROUTING_S390_ADAPTER 3 +#define KVM_IRQ_ROUTING_EXTENDED_MSI 4 struct kvm_irq_routing_entry { __u32 gsi;