aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual/kvm/api.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/virtual/kvm/api.txt')
-rw-r--r--Documentation/virtual/kvm/api.txt53
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.
14334.52 KVM_SET_GSI_ROUTING 14334.52 KVM_SET_GSI_ROUTING
1434 1434
1435Capability: KVM_CAP_IRQ_ROUTING 1435Capability: KVM_CAP_IRQ_ROUTING
1436Architectures: x86 s390 1436Architectures: x86 s390 arm arm64
1437Type: vm ioctl 1437Type: vm ioctl
1438Parameters: struct kvm_irq_routing (in) 1438Parameters: struct kvm_irq_routing (in)
1439Returns: 0 on success, -1 on error 1439Returns: 0 on success, -1 on error
1440 1440
1441Sets the GSI routing table entries, overwriting any previously set entries. 1441Sets the GSI routing table entries, overwriting any previously set entries.
1442 1442
1443On arm/arm64, GSI routing has the following limitation:
1444- GSI routing does not apply to KVM_IRQ_LINE but only to KVM_IRQFD.
1445
1443struct kvm_irq_routing { 1446struct 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
1471No flags are specified so far, the corresponding field must be set to zero. 1474flags:
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
1473struct kvm_irq_routing_irqchip { 1482struct 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
1497If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
1498for the device that wrote the MSI message. For PCI, this is usually a
1499BFD identifier in the lower 16 bits.
1500
1485On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS 1501On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS
1486feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled, 1502feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled,
1487address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of 1503address_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
2202flags: KVM_MSI_VALID_DEVID: devid contains a valid value 2218flags: KVM_MSI_VALID_DEVID: devid contains a valid value. The per-VM
2203devid: 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
2207The per-VM KVM_CAP_MSI_DEVID capability advertises the need to provide 2223If KVM_MSI_VALID_DEVID is set, devid contains a unique device identifier
2208the device ID. If this capability is not set, userland cannot rely on 2224for the device that wrote the MSI message. For PCI, this is usually a
2209the kernel to allow the KVM_MSI_VALID_DEVID flag being set. 2225BFD identifier in the lower 16 bits.
2210 2226
2211On x86, address_hi is ignored unless the KVM_CAP_X2APIC_API capability is 2227On x86, address_hi is ignored unless the KVM_X2APIC_API_USE_32BIT_IDS
2212enabled. If it is enabled, address_hi bits 31-8 provide bits 31-8 of the 2228feature of KVM_CAP_X2APIC_API capability is enabled. If it is enabled,
2213destination id. Bits 7-0 of address_hi must be zero. 2229address_hi bits 31-8 provide bits 31-8 of the destination id. Bits 7-0 of
2230address_hi must be zero.
2214 2231
2215 2232
22164.71 KVM_CREATE_PIT2 22334.71 KVM_CREATE_PIT2
@@ -2383,9 +2400,13 @@ Note that closing the resamplefd is not sufficient to disable the
2383irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment 2400irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment
2384and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. 2401and need not be specified with KVM_IRQFD_FLAG_DEASSIGN.
2385 2402
2386On ARM/ARM64, the gsi field in the kvm_irqfd struct specifies the Shared 2403On arm/arm64, gsi routing being supported, the following can happen:
2387Peripheral Interrupt (SPI) index, such that the GIC interrupt ID is 2404- in case no routing entry is associated to this gsi, injection fails
2388given 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
23904.76 KVM_PPC_ALLOCATE_HTAB 24114.76 KVM_PPC_ALLOCATE_HTAB
2391 2412