I'm working on an implementation of virtio-vhost-user for Cloud Hypervisor.
Right now, the main challenge actually appears to be handling 
VHOST_USER_SET_VRING_KICK.
The obvious userspace implementation is going to be somewhat slow, so using the 
provided FD as an irqfd is preferable.  However, this runs into two problems:

1. If the MSI-X interrupt is masked, there is no obvious way for the
   corresponding bit in the Pending Bit Array (PBA).

2. There needs to be a mapping from queue numbers to irqfds.  Right
   now, this mapping is read-only, so it is easy to access from any
   number of threads.  Making it writable means that access needs a
   lock or lock-free algorithms unless it is only accessed from one
   thread.  The last is a nontrivial refactoring in Cloud Hypervisor.

Can I count on VHOST_USER_SET_VRING_KICK have to come before enabling
the device?  Then I can rely on the device being disabled (and so
having no interrupts enabled) before all file descriptors have arrived.

Also, is there a solution to the first problem?  Watch it with
epoll/io_uring/etc and set it in userspace?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

Attachment: OpenPGP_0xB288B55FFF9C22C1.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to