diff options
Diffstat (limited to 'Documentation/virtual/kvm/api.txt')
-rw-r--r-- | Documentation/virtual/kvm/api.txt | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 5237e1b2fd66..739db9ab16b2 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt | |||
@@ -1433,13 +1433,16 @@ KVM_ASSIGN_DEV_IRQ. Partial deassignment of host or guest IRQ is allowed. | |||
1433 | 4.52 KVM_SET_GSI_ROUTING | 1433 | 4.52 KVM_SET_GSI_ROUTING |
1434 | 1434 | ||
1435 | Capability: KVM_CAP_IRQ_ROUTING | 1435 | Capability: KVM_CAP_IRQ_ROUTING |
1436 | Architectures: x86 s390 | 1436 | Architectures: x86 s390 arm arm64 |
1437 | Type: vm ioctl | 1437 | Type: vm ioctl |
1438 | Parameters: struct kvm_irq_routing (in) | 1438 | Parameters: struct kvm_irq_routing (in) |
1439 | Returns: 0 on success, -1 on error | 1439 | Returns: 0 on success, -1 on error |
1440 | 1440 | ||
1441 | Sets the GSI routing table entries, overwriting any previously set entries. | 1441 | Sets the GSI routing table entries, overwriting any previously set entries. |
1442 | 1442 | ||
1443 | On arm/arm64, GSI routing has the following limitation: | ||
1444 | - GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD. | ||
1445 | |||
1443 | struct kvm_irq_routing { | 1446 | struct kvm_irq_routing { |
1444 | __u32 nr; | 1447 | __u32 nr; |
1445 | __u32 flags; | 1448 | __u32 flags; |
@@ -1468,7 +1471,13 @@ struct kvm_irq_routing_entry { | |||
1468 | #define KVM_IRQ_ROUTING_S390_ADAPTER 3 | 1471 | #define KVM_IRQ_ROUTING_S390_ADAPTER 3 |
1469 | #define KVM_IRQ_ROUTING_HV_SINT 4 | 1472 | #define KVM_IRQ_ROUTING_HV_SINT 4 |
1470 | 1473 | ||
1471 | No flags are specified so far, the corresponding field must be set to zero. | 1474 | flags: |
1475 | - KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry | ||
1476 | type, specifies that the devid field contains a valid value. The per-VM | ||
1477 | KVM_CAP_MSI_DEVID capability advertises the requirement to provide | ||
1478 | the device ID. If this capability is not available, userspace should | ||
1479 | never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail. | ||
1480 | - zero otherwise | ||
1472 | 1481 | ||
1473 | struct kvm_irq_routing_irqchip { | 1482 | struct kvm_irq_routing_irqchip { |
1474 | __u32 irqchip; | 1483 | __u32 irqchip; |
@@ -1479,9 +1488,16 @@ struct kvm_irq_routing_msi { | |||
1479 | __u32 address_lo; | 1488 | __u32 address_lo; |
1480 | __u32 address_hi; | 1489 | __u32 address_hi; |
1481 | __u32 data; | 1490 | __u32 data; |
1482 | __u32 pad; | 1491 | union { |
1492 | __u32 pad; | ||
1493 | __u32 devid; | ||
1494 | }; | ||
1483 | }; | 1495 | }; |
1484 | 1496 | ||
1497 | If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier | ||
1498 | for the device that wrote the MSI message. For PCI, this is usually a | ||
1499 | BFD identifier in the lower 16 bits. | ||
1500 | |||
1485 | On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS | 1501 | On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS |
1486 | feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, | 1502 | feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, |
1487 | address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of | 1503 | address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of |
@@ -2199,18 +2215,19 @@ struct kvm_msi { | |||
2199 | __u8 pad[12]; | 2215 | __u8 pad[12]; |
2200 | }; | 2216 | }; |
2201 | 2217 | ||
2202 | flags: KVM_MSI_VALID_DEVID: devid contains a valid value | 2218 | flags: KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM |
2203 | devid: If KVM_MSI_VALID_DEVID is set, contains a unique device identifier | 2219 | KVM_CAP_MSI_DEVID capability advertises the requirement to provide |
2204 | for the device that wrote the MSI message. | 2220 | the device ID. If this capability is not available, userspace |
2205 | For PCI, this is usually a BFD identifier in the lower 16 bits. | 2221 | should never set the KVM_MSI_VALID_DEVID flag as the ioctl might fail. |
2206 | 2222 | ||
2207 | The per-VM KVM_CAP_MSI_DEVID capability advertises the need to provide | 2223 | If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier |
2208 | the device ID. If this capability is not set, userland cannot rely on | 2224 | for the device that wrote the MSI message. For PCI, this is usually a |
2209 | the kernel to allow the KVM_MSI_VALID_DEVID flag being set. | 2225 | BFD identifier in the lower 16 bits. |
2210 | 2226 | ||
2211 | On x86, address_hi is ignored unless the KVM_CAP_X2APIC_API capability is | 2227 | On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS |
2212 | enabled. If it is enabled, address_hi bits 31-8 provide bits 31-8 of the | 2228 | feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, |
2213 | destination id. Bits 7-0 of address_hi must be zero. | 2229 | address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of |
2230 | address_hi must be zero. | ||
2214 | 2231 | ||
2215 | 2232 | ||
2216 | 4.71 KVM_CREATE_PIT2 | 2233 | 4.71 KVM_CREATE_PIT2 |
@@ -2383,9 +2400,13 @@ Note that closing the resamplefd is not sufficient to disable the | |||
2383 | irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment | 2400 | irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment |
2384 | and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. | 2401 | and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. |
2385 | 2402 | ||
2386 | On ARM/ARM64, the gsi field in the kvm_irqfd struct specifies the Shared | 2403 | On arm/arm64, gsi routing being supported, the following can happen: |
2387 | Peripheral Interrupt (SPI) index, such that the GIC interrupt ID is | 2404 | - in case no routing entry is associated to this gsi, injection fails |
2388 | given by gsi + 32. | 2405 | - in case the gsi is associated to an irqchip routing entry, |
2406 | irqchip.pin + 32 corresponds to the injected SPI ID. | ||
2407 | - in case the gsi is associated to an MSI routing entry, the MSI | ||
2408 | message and device ID are translated into an LPI (support restricted | ||
2409 | to GICv3 ITS in-kernel emulation). | ||
2389 | 2410 | ||
2390 | 4.76 KVM_PPC_ALLOCATE_HTAB | 2411 | 4.76 KVM_PPC_ALLOCATE_HTAB |
2391 | 2412 | ||