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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html