Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1163144

[v4 11/16] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

From Feng Wu <feng.wu@intel.com>
Newsgroups linux.kernel
Subject [v4 11/16] KVM: kvm-vfio: User API for VT-d Posted-Interrupts
Date 2015-06-11 13:10 +0200
Message-ID <pA8wW-3OV-37@gated-at.bofh.it> (permalink)
References <pA8wV-3OV-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch adds and documents two new attributes
KVM_DEV_VFIO_DEVICE_POST_IRQ and KVM_DEV_VFIO_DEVICE_UNPOST_IRQ
in KVM_DEV_VFIO_DEVICE group. The new attributes are used for
VT-d Posted-Interrupts.

When guest OS changes the interrupt configuration for an
assigned device, such as, MSI/MSIx data/address fields,
QEMU will use this IRQ attribute to tell KVM to update the
related IRTE according the VT-d Posted-Interrrupts Specification,
such as, the guest vector should be updated in the related IRTE.

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

diff --git a/Documentation/virtual/kvm/devices/vfio.txt b/Documentation/virtual/kvm/devices/vfio.txt
index 6186e6d..34925e1 100644
--- a/Documentation/virtual/kvm/devices/vfio.txt
+++ b/Documentation/virtual/kvm/devices/vfio.txt
@@ -42,3 +42,12 @@ In such a situation, -EAGAIN is returned. It is advised to to set the
 forwarding before the VFIO signaling is set up, this avoids trial and errors.
 
 Unforwarding can happen at any time.
+
+  KVM_DEV_VFIO_DEVICE_POST_IRQ: set a VFIO device IRQ as posted
+  KVM_DEV_VFIO_DEVICE_UNPOST_IRQ: set a VFIO device IRQ as remapped
+For this attribute, kvm_device_attr.addr points to a kvm_vfio_dev_irq struct.
+
+When guest OS changes the interrupt configuration for an assigned device,
+such as, MSI/MSIx data/address fields, QEMU will use this IRQ attribute
+to tell KVM to update the related IRTE according the VT-d Posted-Interrrupts
+Specification, such as, the guest vector should be updated in the related IRTE.
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 798f3e4..6e17596 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1002,6 +1002,8 @@ struct kvm_device_attr {
 #define  KVM_DEV_VFIO_DEVICE			2
 #define   KVM_DEV_VFIO_DEVICE_FORWARD_IRQ			1
 #define   KVM_DEV_VFIO_DEVICE_UNFORWARD_IRQ			2
+#define   KVM_DEV_VFIO_DEVICE_POST_IRQ				3
+#define   KVM_DEV_VFIO_DEVICE_UNPOST_IRQ			4
 
 enum kvm_device_type {
 	KVM_DEV_TYPE_FSL_MPIC_20	= 1,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[v4 00/16] Add VT-d Posted-Interrupts support Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 12/16] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
    RE: [v4 12/16] KVM: kvm-vfio: implement the VFIO skeleton for VT-d  Posted-Interrupts "Wu, Feng" <feng.wu@intel.com> - 2015-06-12 07:00 +0200
  [v4 13/16] KVM: x86: kvm-vfio: VT-d posted-interrupts setup Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
    RE: [v4 13/16] KVM: x86: kvm-vfio: VT-d posted-interrupts setup "Wu, Feng" <feng.wu@intel.com> - 2015-06-12 07:00 +0200
  [v4 15/16] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 07/16] KVM: make kvm_set_msi_irq() public Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 10/16] KVM: kvm-vfio: wrappers to VFIO external API device helpers Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 11/16] KVM: kvm-vfio: User API for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 05/16] KVM: Add interfaces to control PI outside vmx Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 14/16] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 02/16] KVM: Add some helper functions for Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 16/16] KVM: Warn if 'SN' is set during posting interrupts by software Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 04/16] KVM: Get Posted-Interrupts descriptor address from struct kvm_vcpu Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 01/16] KVM: Extend struct pi_desc for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 09/16] VFIO: external user API for interaction Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200

csiph-web