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: 6689641 Return-Path: X-Original-To: patchwork-kvm@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 CB936C05AC for ; Mon, 29 Jun 2015 15:38:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAD97202E6 for ; Mon, 29 Jun 2015 15:38:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1791C202BE for ; Mon, 29 Jun 2015 15:38:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753636AbbF2Ph7 (ORCPT ); Mon, 29 Jun 2015 11:37:59 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:33176 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753595AbbF2Pht (ORCPT ); Mon, 29 Jun 2015 11:37:49 -0400 Received: by wgck11 with SMTP id k11so144882358wgc.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=cu7bmtVhM6MUFZt03AK14UaLJceXT3r7MnqOvqXqTU4WGbWBp8WA/sgTEnMUzWwySv Y4a1VQUHEl/NOo4Nm8arYo5z3v2p2tU+2byrzQKEnYFUe24C69YwJB+wqbvYyaYbFELm RBU/AfBHZSrXvyq7YhEVbHYmXRG3/llUcFgX5Kp5r8mMqdOsaePm9G9bTfGOVReTfTeW UF7qV/gNa0yIhL4BiKcFGvPmJJ5qu8mt2gxlMS/TwPB9PsRNXMt+1s7EK5LjKRWpfCXU 4tQU58IedA6QQs1yQmrCPmOXPsJSz19qd0CtPxJfzkrbHqDjrGWN6UOQ8S50EBMamPm5 BjSw== X-Gm-Message-State: ALoCoQl9BO0KNne/LtFWlmU03ENvnFNFYxgXaH5VgQKYYFqWMHdHAdbxhimZPV2oD8iq1vOdTXiX 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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;