public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Feng Wu <feng.wu@intel.com>
To: alex.williamson@redhat.com, pbonzini@redhat.com
Cc: kvm@vger.kernel.org, Feng Wu <feng.wu@intel.com>
Subject: [RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO
Date: Thu, 20 Nov 2014 17:05:15 +0800	[thread overview]
Message-ID: <1416474316-32159-2-git-send-email-feng.wu@intel.com> (raw)
In-Reply-To: <1416474316-32159-1-git-send-email-feng.wu@intel.com>

Add new group KVM_DEV_VFIO_INTERRUPT and command
KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it.

This is used for VT-d Posted-Interrupts setup.

Signed-off-by: Feng Wu <feng.wu@intel.com>
---
 Documentation/virtual/kvm/devices/vfio.txt |    8 ++++++++
 include/uapi/linux/kvm.h                   |   14 ++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/Documentation/virtual/kvm/devices/vfio.txt b/Documentation/virtual/kvm/devices/vfio.txt
index ef51740..bd99176 100644
--- a/Documentation/virtual/kvm/devices/vfio.txt
+++ b/Documentation/virtual/kvm/devices/vfio.txt
@@ -13,6 +13,7 @@ VFIO-group is held by KVM.
 
 Groups:
   KVM_DEV_VFIO_GROUP
+  KVM_DEV_VFIO_INTERRUPT
 
 KVM_DEV_VFIO_GROUP attributes:
   KVM_DEV_VFIO_GROUP_ADD: Add a VFIO group to VFIO-KVM device tracking
@@ -20,3 +21,10 @@ KVM_DEV_VFIO_GROUP attributes:
 
 For each, kvm_device_attr.addr points to an int32_t file descriptor
 for the VFIO group.
+
+KVM_DEV_VFIO_INTERRUPT attributes:
+  KVM_DEV_VFIO_INTERRUPT_POSTING_IRQ: Set up the interrupt configuration for
+VT-d Posted-Interrrupts
+
+For each, kvm_device_attr.addr points to struct kvm_posted_intr, which
+include the needed information for VT-d Posted-Interrupts setup.
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 6076882..5544fcc 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -943,9 +943,23 @@ struct kvm_device_attr {
 	__u64	addr;		/* userspace address of attr data */
 };
 
+struct virq_info {
+	__u32	index;		/* index of the msi/msix entry */
+	int	virq;		/* virq of the interrupt */
+};
+
+struct kvm_posted_intr {
+	__u32	fd;		/* file descriptor of the VFIO device */
+	__u32	count;
+	bool	msix;
+	struct virq_info virq_info[0];
+};
+
 #define  KVM_DEV_VFIO_GROUP			1
 #define   KVM_DEV_VFIO_GROUP_ADD			1
 #define   KVM_DEV_VFIO_GROUP_DEL			2
+#define  KVM_DEV_VFIO_INTERRUPT			2
+#define   KVM_DEV_VFIO_INTERRUPT_POSTING_IRQ		1
 
 enum kvm_device_type {
 	KVM_DEV_TYPE_FSL_MPIC_20	= 1,
-- 
1.7.1


  reply	other threads:[~2014-11-20  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20  9:05 [RFC PATCH v1 0/2] Define some VFIO interfaces for VT-d Posted-Interrupts Feng Wu
2014-11-20  9:05 ` Feng Wu [this message]
2014-11-20 15:53   ` [RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO Alex Williamson
2014-11-20 16:03     ` Eric Auger
     [not found]     ` <E959C4978C3B6342920538CF579893F0022A8711@SHSMSX104.ccr.corp.intel.com>
2014-11-21 19:35       ` Alex Williamson
2014-11-20  9:05 ` [RFC PATCH v1 2/2] vfio: Add VFIO API vfio_msi_get_irq Feng Wu
2014-11-20 16:05   ` Alex Williamson
2014-11-20 16:12     ` Eric Auger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416474316-32159-2-git-send-email-feng.wu@intel.com \
    --to=feng.wu@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox