registering ioeventfd in qemu/kvm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am trying to generate eventfd upon a IO write from the guest, say it
is at offset IO_NOTIFY_REG (0x10). When the guest writes to this
register, I get control to QEMU's to the write function associated in
mypci_iomem_ops. However, instead of this I would like to register an
eventfd.

To achieve that, first I tried:
       memory_region_add_eventfd(&mypci->bar_iomem, IO_NOTIFY_REG, 4,
true, 1, fd);

When this failed to generate events, I tried:

 int rc = kvm_set_ioeventfd_mmio(fd, IO_NOTIFY_REG, 1, 1, 4);

The RC value is 0, however event is not generated.

In the write function associated in mypci_iomem_ops, if I do a manual
write(fd, &val, (sizeof(uint64_t)); an event gets generated.

I have created a PCI device with iomem configured as follows:

        /* region for IOMEM */
        memory_region_init_io(&mypci->bar_iomem, &mypci_iomem_ops, mypci,
            "mypci-iomem", IOMEM_SIZE);

        pci_register_bar(&mypci->pci_dev, 0, PCI_BASE_ADDRESS_SPACE_IO,
            &mypci->bar_iomem);

What am I missing?
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux