Re: [PATCH 0/8][v2] MSI-X mask emulation support for assigned device

Avi Kivity
2010-10-20T16:13:58Z

On 10/20/2010 05:59 PM, Michael S. Tsirkin wrote:
> >
> > One ugly way is to use two eventfds, one counting mask events, one
> > counting unmask events. The difference is the value if the masked
> > bit.
> >
> > Another option is to use
> > http://permalink.gmane.org/gmane.linux.kernel.commits.head/188038
> > which allows kvm to maintain a counter using eventfd. The vfio
> > state machine then looks like:
> >
> > interrupt:
> > if counter == 0 mask interrupts, set pending bit, wait for counter
> > to become 1
> > if counter == 1 forward it
> > counter becomes 1: unmask, forward interrupt if pending
>
> One issue is that this page has a ton of other info.
> KVM would have to keep all that in kernel...

Or we'd make kvm an "accelerator" and pass through other accesses to
userspace. I don't like it because it's a blurry programming model. At
the very least it has to be documented very well.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.