Skip to contentSkip to conversation

hw/misc/pci-testdev.c write access does not work

Qemu-devel Alexander Gordeev 2 participants 2 messages Jul 8, 2016

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 8 lines · Alexander Gordeev

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.

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::count field.

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