KVM: Add fields for MSI device assignment
authorSheng Yang <sheng@linux.intel.com>
Mon, 24 Nov 2008 06:32:53 +0000 (14:32 +0800)
committerAvi Kivity <avi@redhat.com>
Wed, 31 Dec 2008 14:55:01 +0000 (16:55 +0200)
Prepared for kvm_arch_assigned_device_msi_dispatch().

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
include/linux/kvm.h
include/linux/kvm_host.h

index 44fd7fa0af2b769b20dd0033a7d3366d63f66f67..bb283c388a24b06b60d8ff0fcf08cf60db272be5 100644 (file)
@@ -507,10 +507,17 @@ struct kvm_assigned_irq {
        __u32 guest_irq;
        __u32 flags;
        union {
+               struct {
+                       __u32 addr_lo;
+                       __u32 addr_hi;
+                       __u32 data;
+               } guest_msi;
                __u32 reserved[12];
        };
 };
 
 #define KVM_DEV_ASSIGN_ENABLE_IOMMU    (1 << 0)
 
+#define KVM_DEV_IRQ_ASSIGN_ENABLE_MSI  (1 << 0)
+
 #endif
index c3d4b96a08faac115ea0a9b2dd63ef14ea4323a6..8091a4d90ddff59ec3d9e6ca01187da9c1fabefe 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/mm.h>
 #include <linux/preempt.h>
 #include <linux/marker.h>
+#include <linux/msi.h>
 #include <asm/signal.h>
 
 #include <linux/kvm.h>
@@ -307,8 +308,11 @@ struct kvm_assigned_dev_kernel {
        int host_devfn;
        int host_irq;
        int guest_irq;
+       struct msi_msg guest_msi;
 #define KVM_ASSIGNED_DEV_GUEST_INTX    (1 << 0)
+#define KVM_ASSIGNED_DEV_GUEST_MSI     (1 << 1)
 #define KVM_ASSIGNED_DEV_HOST_INTX     (1 << 8)
+#define KVM_ASSIGNED_DEV_HOST_MSI      (1 << 9)
        unsigned long irq_requested_type;
        int irq_source_id;
        struct pci_dev *dev;