hw/misc/pci-testdev.c write access does not work
Hi all,
Looks like hw/misc/pci-testdev.c does not work for wildcard-eventfd and datamatch-eventfd tests (more precisely - for any non no-eventfd tests).
Test writes to pci-testdev's addresses (reported by PCITestDevHdr::offset field) do not cause invocations of MemoryRegionOps::write() callback.
(I found that by putting debug output to pci_testdev_write() and using vmexit testcase from kvm-unit-tests).
The reason kvm-unit-tests does not hit this issue is because vmexit does not check number of successful writes reported via PCITestDevHdr::count field.
Quoted 8 lines · Alexander Gordeev
Hi all,
Looks like
hw/misc/pci-testdev.cdoes not work for wildcard-eventfd and datamatch-eventfd tests (more precisely - for any non no-eventfd tests).Test writes to pci-testdev's addresses (reported by
PCITestDevHdr::offsetfield) do not cause invocations ofMemoryRegionOps::write()callback.
Quoted 6 lines
(I found that by putting debug output to
pci_testdev_write()and using vmexit testcase from kvm-unit-tests).The reason kvm-unit-tests does not hit this issue is because vmexit does not check number of successful writes reported via
PCITestDevHdr::countfield.
In the eventfd case, the writes are hijacked by KVM and cause an eventfd write instead of invoking the callback. The idea is that the written value doesn't matter (or if it matters, it's matched via datamatch) and eventually userspace will process the eventfd write in another thread.
So this is expected.
Paolo