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: Eric Auger X-Patchwork-Id: 6753991 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 66B56C05AC for ; Thu, 9 Jul 2015 08:22:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B4262049C for ; Thu, 9 Jul 2015 08:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B70220640 for ; Thu, 9 Jul 2015 08:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751154AbbGIIWv (ORCPT ); Thu, 9 Jul 2015 04:22:51 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:35864 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750866AbbGIIWq (ORCPT ); Thu, 9 Jul 2015 04:22:46 -0400 Received: by widjy10 with SMTP id jy10so237850045wid.1 for ; Thu, 09 Jul 2015 01:22:45 -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=fBxEhycXEYoi+ImYb/RxYok5HoH0jEpraYoIjFwoysc=; b=Ns/dVY0+irJth6/CDZQGuWZaqDdFNjuFjCDYGzXwgtKt84uaG5wxBmtBNAG6nnbNnF PKAVs+20zLttHmMTCxoZroH+r18D7mQMfPgxB4p/2hOtX7CAH8iWbLZKQd1Eet1wOwTC 1M9cIfMh0ql0/oJuJhhKsovXYQZd/RsIaXr85N2IpNbLd84Qv0V4TLpsS0Y7LyXtx4+x Ugnj9gJKkO4YnUHy1i1+gR1//qnZFXeLK1Sc4E/NOf3ecIVKLL0xzgGpkfoBUOvEnxxr yeW5tM+dSdOgXHy2LGa31vv3mQsg+qR10Gmb8uN9m9ciSHU7mJrhTuRgNR7hcFCcX1/h 1/+A== X-Gm-Message-State: ALoCoQlW4yC780nH1OO7vsHIZkHY8ARtD577qSXCVevT5LUZcfsHDsUwCji8I5f7EbWP4U/YmOyi 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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.2 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 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 Reviewed-by: Andre Przywara --- 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;