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: Eric Auger X-Patchwork-Id: 6689831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A30EC05AC for ; Mon, 29 Jun 2015 15:42:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E630202BE for ; Mon, 29 Jun 2015 15:42:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 585EB202E6 for ; Mon, 29 Jun 2015 15:42:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9b9S-00047D-20; Mon, 29 Jun 2015 15:39:18 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9b8M-0003P9-6G for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2015 15:38:11 +0000 Received: by wicgi11 with SMTP id gi11so75971072wic.0 for ; Mon, 29 Jun 2015 08:37:48 -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=tVRSTCEqix1FJvXpbzs+RbCw+jlVQvEzFPDF0LNNB6M=; b=UA6mO5ijfDi1Tofo7jzle7+cArdGMzQjgW+s6RcW/TpdirOPjArnQb49w2onKbTkhn lNvmgvwKlH9r2gi6TIyJ5dkhqPmKXeyC0EIFN/zvkOZPwXWry+kuSoWIsdVK1AkiI0Mp 6ydfLRP5FZtTD77zCuuQBn2BV2sjMGry+Iq5OklE/D7bmS1KnX2WO3IniT0ZJgV6cBje 2Mksxl98JH7ZI5IiGNTAEXmpPkKSPJTcaF7ulfGDaP/jB8js5hcoWJjdXDmZli3iYXVa Gm/uPDeAJXupdk/PdPk4Mu+XtD/DabDB/P2IKUbhGedYPx2OCM/99TMjV5qIpn+GwT95 mh4Q== X-Gm-Message-State: ALoCoQkULhnbCqPN5pFBfkLeqSJZbVQyuHgycGe/P1lMimMAPZnj2o0pFHzaGUnf6zvGAPpfM/Jw 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150629_083810_422416_C69B6F26 X-CRM114-Status: GOOD ( 13.34 ) X-Spam-Score: -2.6 (--) Cc: pbonzini@redhat.com, p.fedin@samsung.com, linux-kernel@vger.kernel.org, patches@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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, 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 Tested-by: Pavel Fedin --- 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;