diff options
author | Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 2018-06-18 19:42:01 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-06-19 12:26:38 +0100 |
commit | e59679d2a19c5f25a973086ccd356328070e6009 (patch) | |
tree | 9bac6a07381ee0ecdc1033ca61ee89ed165b8acd /hw | |
parent | ff01b5dbbd040d39619f0f033da6eac5dbed3b2b (diff) | |
download | kvmtool-e59679d2a19c5f25a973086ccd356328070e6009.tar.gz |
irq: add irqfd helpers
Add helpers to add and remove IRQFD routing for both irqchips and MSIs.
We have to make a special case of IRQ lines on ARM where the
initialisation order goes like this:
(1) Devices reserve their IRQ lines
(2) VGIC is setup with VGIC_CTRL_INIT (in a late_init call)
(3) MSIs are reserved lazily, when the guest needs them
Since we cannot setup IRQFD before (2), store the IRQFD routing for IRQ
lines temporarily until we're ready to submit them.
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/pci-shmem.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/hw/pci-shmem.c b/hw/pci-shmem.c index 512b5b06..107043e9 100644 --- a/hw/pci-shmem.c +++ b/hw/pci-shmem.c @@ -127,7 +127,6 @@ static void callback_mmio_msix(struct kvm_cpu *vcpu, u64 addr, u8 *data, u32 len int pci_shmem__get_local_irqfd(struct kvm *kvm) { int fd, gsi, r; - struct kvm_irqfd irqfd; if (local_fd == 0) { fd = eventfd(0, 0); @@ -143,12 +142,7 @@ int pci_shmem__get_local_irqfd(struct kvm *kvm) gsi = pci_shmem_pci_device.irq_line; } - irqfd = (struct kvm_irqfd) { - .fd = fd, - .gsi = gsi, - }; - - r = ioctl(kvm->vm_fd, KVM_IRQFD, &irqfd); + r = irq__add_irqfd(kvm, gsi, fd, -1); if (r < 0) return r; |