From patchwork Mon Jun 29 15:37: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: 50424 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 E600D228D9 for ; Mon, 29 Jun 2015 15:37:51 +0000 (UTC) Received: by wiwz6 with SMTP id z6sf2588412wiw.0 for ; Mon, 29 Jun 2015 08:37:51 -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=tVRSTCEqix1FJvXpbzs+RbCw+jlVQvEzFPDF0LNNB6M=; b=ZZxP52UItVCjNk7zmcnHLg1GB87xmH1LjhENvvxDtGFb3t3ULEbKWehvTXwGcPbEVK mDuZN47RuRcg368Q54uujZ7Z2hhUeU+gqtujWhOT0/gWepF8AT1OyMKWWwexQ9xa6LD2 sr/V2DyyOujzzUUmmrkvHYZKcTRhO/PetuwYGfVjmuFPGhd/7bIlBPBcNjU+h2JD3nWp 5junzMJY9iQQJZUvXzxH3jDke4YZmtOoZcS04xSNEvd+d8snGO30TwAt7lMFLlPtFYX4 sUP6rjhdkFqrVAbnrG6gPYKmr/Ots7w5J2ymGBmX85xsJW/v5+zwNF/uJagd87t+BSfQ Rb0w== X-Gm-Message-State: ALoCoQkPYCUREk0pQ53CEWoP20Ysc3S97uf/5amI8LGOB2DIQ2Rwq5ug+py08veV8YHhR83HySKm X-Received: by 10.152.37.101 with SMTP id x5mr11202539laj.5.1435592271225; Mon, 29 Jun 2015 08:37:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.9 with SMTP id ky9ls649340lab.98.gmail; Mon, 29 Jun 2015 08:37:50 -0700 (PDT) X-Received: by 10.152.37.102 with SMTP id x6mr14666465laj.69.1435592270954; Mon, 29 Jun 2015 08:37:50 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id o3si16303046laj.143.2015.06.29.08.37.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagh6 with SMTP id h6so58571894lag.2 for ; Mon, 29 Jun 2015 08:37:50 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr14776286lag.86.1435592270850; Mon, 29 Jun 2015 08:37:50 -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 hn6csp1789977lbb; Mon, 29 Jun 2015 08:37:50 -0700 (PDT) X-Received: by 10.180.83.137 with SMTP id q9mr24830386wiy.68.1435592268606; Mon, 29 Jun 2015 08:37:48 -0700 (PDT) Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com. [209.85.212.171]) by mx.google.com with ESMTPS id p3si13723451wia.63.2015.06.29.08.37.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.171 as permitted sender) client-ip=209.85.212.171; Received: by wibdq8 with SMTP id dq8so75970242wib.1 for ; Mon, 29 Jun 2015 08:37:48 -0700 (PDT) X-Received: by 10.194.100.42 with SMTP id ev10mr28148461wjb.50.1435592268323; Mon, 29 Jun 2015 08:37:48 -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.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:37:47 -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 1/7] KVM: api: add kvm_irq_routing_extended_msi Date: Mon, 29 Jun 2015 17:37:11 +0200 Message-Id: <1435592237-17924-2-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.42 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 composes the MSI msg. Let's create a new routing entry type, dubbed KVM_IRQ_ROUTING_EXTENDED_MSI and use the __u32 pad space to convey the device ID. Signed-off-by: Eric Auger --- RFC -> PATCH - remove kvm_irq_routing_extended_msi and use union instead --- Documentation/virtual/kvm/api.txt | 9 ++++++++- include/uapi/linux/kvm.h | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index d20fd94..6426ae9 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -1414,7 +1414,10 @@ struct kvm_irq_routing_entry { __u32 gsi; __u32 type; __u32 flags; - __u32 pad; + union { + __u32 pad; + __u32 devid; + }; union { struct kvm_irq_routing_irqchip irqchip; struct kvm_irq_routing_msi msi; @@ -1427,6 +1430,10 @@ 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 + +In case of KVM_IRQ_ROUTING_EXTENDED_MSI routing type, devid is used to convey +the device ID. No flags are specified so far, the corresponding field must be set to zero. diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 2a23705..8484681 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -841,12 +841,16 @@ 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; __u32 type; __u32 flags; - __u32 pad; + union { + __u32 pad; + __u32 devid; + }; union { struct kvm_irq_routing_irqchip irqchip; struct kvm_irq_routing_msi msi;