]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
KVM: api: introduce KVM_IRQ_ROUTING_EXTENDED_MSI
authorEric Auger <eric.auger@linaro.org>
Thu, 18 Jun 2015 13:26:59 +0000 (15:26 +0200)
committerJulien Grall <julien.grall@citrix.com>
Mon, 28 Sep 2015 11:05:13 +0000 (12:05 +0100)
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 <eric.auger@linaro.org>
Documentation/virtual/kvm/api.txt
include/uapi/linux/kvm.h

index 1b531552f9e93b5629510c3f6daa7dcd2b48966a..30941398f059356f1b8c4a993ff80b6db241f9d8 100644 (file)
@@ -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;
index 1c48defb66de6cd913f80d0b2f36e88fffc05b00..817586fa22a6b5a62bcf96aaa7ff17e136de5a94 100644 (file)
@@ -830,7 +830,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 {
@@ -845,6 +848,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;