Skip to contentSkip to conversation

ioeventfd question

DISCUSSION Sasha Levin 2 participants 3 messages May 26, 2011 – May 27, 2011 KVM

lore
Share & tools
lore
#0 lore raw

Hi Avi,

I'm working on adding ioeventfd support into tools/kvm/. Currently the implementation creates ioeventfd entries at the 'VIRTIO_PCI_QUEUE_NOTIFY' of each device and waits on all of them using epoll().
The basics are working - when IO is triggered I receive a notification using the event instead of an exit.

I couldn't find a way to retrieve the value written to the PIO port - the guest memory at that location doesn't change, 'reading' the event just returns 1 (as expected) and I couldn't find anything else which might suggest what value was written to the PIO port.

This is an issue with devices which have multiple virtio-rings, such as virtio-net.

Signature · 1 line
Sasha.
#1 lore raw
Quoted 9 lines · Sasha Levin

Hi Avi,

I'm working on adding ioeventfd support into tools/kvm/. Currently the implementation creates ioeventfd entries at the 'VIRTIO_PCI_QUEUE_NOTIFY' of each device and waits on all of them using epoll().
The basics are working - when IO is triggered I receive a notification using the event instead of an exit.

Quoted 4 lines

I couldn't find a way to retrieve the value written to the PIO port - the guest memory at that location doesn't change, 'reading' the event just returns 1 (as expected) and I couldn't find anything else which might suggest what value was written to the PIO port.

You can use KVM_IOEVENTFD_FLAG_DATAMATCH for that.

Signature · 2 lines
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
#2 lore raw
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Sasha Levin

Hi Avi,

I'm working on adding ioeventfd support into tools/kvm/. Currently the implementation creates ioeventfd entries at the 'VIRTIO_PCI_QUEUE_NOTIFY' of each device and waits on all of them using epoll().
The basics are working - when IO is triggered I receive a notification using the event instead of an exit.

Quoted 7 lines
Quoted 4 lines

I couldn't find a way to retrieve the value written to the PIO port - the guest memory at that location doesn't change, 'reading' the event just returns 1 (as expected) and I couldn't find anything else which might suggest what value was written to the PIO port.

You can use KVM_IOEVENTFD_FLAG_DATAMATCH for that.

Oh, so I need to create one for each vq instead of one for each device.

Thanks!

Signature · 1 line
Sasha.