Problem solved: To enable MSI -> eventfd signalling we had to set the bus master enable bit in PCI config space (bit 2 at offset 4).


*From:* Alex Williamson <>
*Sent:* Thursday, February 22, 2018 10:03PM
*To:* Heid, Oliver <>
*Subject:* Re: [vfio-users] VFIO for PCIe streaming from/to user space

On Thu, 22 Feb 2018 21:44:44 +0100
Oliver Heid <> wrote:

After registering e.g. MSI 0 with

__s32 msifd = eventfd(0, 0);

      struct vfio_irq_set *irq_set;

      irq_set=(struct vfio_irq_set *)malloc(sizeof(struct vfio_irq_set) +

      irq_set->argsz = sizeof(struct vfio_irq_set) + sizeof(__s32);
      irq_set->index = VFIO_PCI_MSI_IRQ_INDEX;
      irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD |
      irq_set->start = 0;
      irq_set->count = 1;
      *(__s32*)&irq_set->data = msifd;
      ioctl(device, VFIO_DEVICE_SET_IRQS, irq_set);

any read by

      __u64 value = 0;
      int ret = read(msifd,&value,sizeof(value));

should acknowledge the MSI, right? Or did I miss something?

What do you mean by "acknowledge"?  This effectively acknowledges the
eventfd, but it's up to your driver to service the hardware upon
receiving the eventfd notification.  The eventfd is only the signaling
mechanism.  Thanks,


vfio-users mailing list

Reply via email to