This patch adds optional callbacks which get called when the VQ gets assigned
an eventfd for notifications, and when it gets assigned with a GSI.
This allows the device to pass the eventfds to 3rd parties which can use
them to notify and get notifications regarding the VQ.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
int (*notify_vq)(struct kvm *kvm, void *dev, u32 vq);
int (*get_pfn_vq)(struct kvm *kvm, void *dev, u32 vq);
int (*get_size_vq)(struct kvm *kvm, void *dev, u32 vq);
+ void (*notify_vq_gsi)(struct kvm *kvm, void *dev, u32 vq, u32 gsi);
+ void (*notify_vq_eventfd)(struct kvm *kvm, void *dev, u32 vq, u32 efd);
};
struct virtio_trans_ops {
ioeventfd__add_event(&ioevent);
+ if (vtrans->virtio_ops->notify_vq_eventfd)
+ vtrans->virtio_ops->notify_vq_eventfd(kvm, vpci->dev, vq, ioevent.fd);
+
return 0;
}
gsi = irq__add_msix_route(kvm, &vpci->msix_table[vec].msg);
vpci->gsis[vpci->queue_selector] = gsi;
+ if (vtrans->virtio_ops->notify_vq_gsi)
+ vtrans->virtio_ops->notify_vq_gsi(kvm, vpci->dev,
+ vpci->queue_selector, gsi);
break;
}
};