diff options
author | Eric Auger <eric.auger@redhat.com> | 2016-07-22 12:20:37 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-07-22 13:51:49 -0400 |
commit | 76a10b86785c5e3fc49bcee355502d035b07e47a (patch) | |
tree | e7f27dfa1b3c6c79a60eab55040be1745ce71903 | |
parent | 3a88bded203591d4683aacdbb65cd0f549bc58cb (diff) |
KVM: api: Pass the devid in the msi routing entry
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 KVM_MSI_VALID_DEVID flag value in
kvm_irq_routing_entry to indicate the msi devid is populated.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 19 | ||||
-rw-r--r-- | include/uapi/linux/kvm.h | 5 |
2 files changed, 21 insertions, 3 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 07049eadb124..415cde1647e9 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -1468,7 +1468,11 @@ struct kvm_irq_routing_entry { | |||
1468 | #define KVM_IRQ_ROUTING_S390_ADAPTER 3 | 1468 | #define KVM_IRQ_ROUTING_S390_ADAPTER 3 |
1469 | #define KVM_IRQ_ROUTING_HV_SINT 4 | 1469 | #define KVM_IRQ_ROUTING_HV_SINT 4 |
1470 | 1470 | ||
1471 | No flags are specified so far, the corresponding field must be set to zero. | 1471 | flags: |
1472 | - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI | ||
1473 | routing entry type, specifies that the devid field contains | ||
1474 | a valid value. | ||
1475 | - zero otherwise | ||
1472 | 1476 | ||
1473 | struct kvm_irq_routing_irqchip { | 1477 | struct kvm_irq_routing_irqchip { |
1474 | __u32 irqchip; | 1478 | __u32 irqchip; |
@@ -1479,9 +1483,20 @@ struct kvm_irq_routing_msi { | |||
1479 | __u32 address_lo; | 1483 | __u32 address_lo; |
1480 | __u32 address_hi; | 1484 | __u32 address_hi; |
1481 | __u32 data; | 1485 | __u32 data; |
1482 | __u32 pad; | 1486 | union { |
1487 | __u32 pad; | ||
1488 | __u32 devid; | ||
1489 | }; | ||
1483 | }; | 1490 | }; |
1484 | 1491 | ||
1492 | devid: If KVM_MSI_VALID_DEVID is set, contains a unique device identifier | ||
1493 | for the device that wrote the MSI message. | ||
1494 | For PCI, this is usually a BFD identifier in the lower 16 bits. | ||
1495 | |||
1496 | The per-VM KVM_CAP_MSI_DEVID capability advertises the requirement to | ||
1497 | provide the device ID. If this capability is not set, userland cannot | ||
1498 | rely on the kernel to allow the KVM_MSI_VALID_DEVID flag being set. | ||
1499 | |||
1485 | struct kvm_irq_routing_s390_adapter { | 1500 | struct kvm_irq_routing_s390_adapter { |
1486 | __u64 ind_addr; | 1501 | __u64 ind_addr; |
1487 | __u64 summary_addr; | 1502 | __u64 summary_addr; |
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index d8c4c324cfae..eb2220895c6e 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h | |||
@@ -879,7 +879,10 @@ struct kvm_irq_routing_msi { | |||
879 | __u32 address_lo; | 879 | __u32 address_lo; |
880 | __u32 address_hi; | 880 | __u32 address_hi; |
881 | __u32 data; | 881 | __u32 data; |
882 | __u32 pad; | 882 | union { |
883 | __u32 pad; | ||
884 | __u32 devid; | ||
885 | }; | ||
883 | }; | 886 | }; |
884 | 887 | ||
885 | struct kvm_irq_routing_s390_adapter { | 888 | struct kvm_irq_routing_s390_adapter { |