diff options
| author | Eric Auger <eric.auger@redhat.com> | 2016-07-22 12:20:41 -0400 |
|---|---|---|
| committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-07-22 13:52:01 -0400 |
| commit | 180ae7b1182344ca617d8b5200306b02a6b5075d (patch) | |
| tree | 927863bc629927451b925be0a483ec9e57307cd3 /Documentation/virtual | |
| parent | d9565a7399d665fa7313122504778cb3d5ef3e19 (diff) | |
KVM: arm/arm64: Enable irqchip routing
This patch adds compilation and link against irqchip.
Main motivation behind using irqchip code is to enable MSI
routing code. In the future irqchip routing may also be useful
when targeting multiple irqchips.
Routing standard callbacks now are implemented in vgic-irqfd:
- kvm_set_routing_entry
- kvm_set_irq
- kvm_set_msi
They only are supported with new_vgic code.
Both HAVE_KVM_IRQCHIP and HAVE_KVM_IRQ_ROUTING are defined.
KVM_CAP_IRQ_ROUTING is advertised and KVM_SET_GSI_ROUTING is allowed.
So from now on IRQCHIP routing is enabled and a routing table entry
must exist for irqfd injection to succeed for a given SPI. This patch
builds a default flat irqchip routing table (gsi=irqchip.pin) covering
all the VGIC SPI indexes. This routing table is overwritten by the
first first user-space call to KVM_SET_GSI_ROUTING ioctl.
MSI routing setup is not yet allowed.
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'Documentation/virtual')
| -rw-r--r-- | Documentation/virtual/kvm/api.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 415cde1647e9..7e5f9afcc693 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; |
| @@ -2374,9 +2377,10 @@ Note that closing the resamplefd is not sufficient to disable the | |||
| 2374 | irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment | 2377 | irqfd. The KVM_IRQFD_FLAG_RESAMPLE is only necessary on assignment |
| 2375 | and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. | 2378 | and need not be specified with KVM_IRQFD_FLAG_DEASSIGN. |
| 2376 | 2379 | ||
| 2377 | On ARM/ARM64, the gsi field in the kvm_irqfd struct specifies the Shared | 2380 | On arm/arm64, gsi routing being supported, the following can happen: |
| 2378 | Peripheral Interrupt (SPI) index, such that the GIC interrupt ID is | 2381 | - in case no routing entry is associated to this gsi, injection fails |
| 2379 | given by gsi + 32. | 2382 | - in case the gsi is associated to an irqchip routing entry, |
| 2383 | irqchip.pin + 32 corresponds to the injected SPI ID. | ||
| 2380 | 2384 | ||
| 2381 | 4.76 KVM_PPC_ALLOCATE_HTAB | 2385 | 4.76 KVM_PPC_ALLOCATE_HTAB |
| 2382 | 2386 | ||
