Re: [PATCH 5/5] ioeventfd: Introduce KVM_IOEVENTFD_FLAG_SOCKET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2011-07-10 at 11:05 +0300, Michael S. Tsirkin wrote:
> On Sun, Jul 10, 2011 at 08:34:43AM +0300, Sasha Levin wrote:
> > On Wed, 2011-07-06 at 20:58 +0300, Michael S. Tsirkin wrote:
> > > On Wed, Jul 06, 2011 at 06:01:46PM +0300, Sasha Levin wrote:
> > > > On Wed, 2011-07-06 at 14:42 +0300, Michael S. Tsirkin wrote:
> > > > > On Wed, Jul 06, 2011 at 07:37:58AM +0300, Sasha Levin wrote:
> > > > > > +	if (p->sock) {
> > > > > > +		socket_write(p->sock, &data, sizeof(data));
> > > > > > +		socket_read(p->sock, &data, sizeof(data));
> > > > > > +		set_val(val, len, data.data);
> > > > > 
> > > > > Same here.
> > > > 
> > > > The socket_read() here I should leave blocking, and spin on it until I
> > > > read something - right?
> > > 
> > > I think it's best to exit to userspace.
> > 
> > Since sock_recvmsg for AF_UNIX SEQPACKET is interruptible, if we fail
> > the read here we'll take a regular MMIO exit and will allow the usermode
> > to deal with the MMIO in a regular way.
> > 
> > I've discussed the issue of usermode might having to handle the same
> > MMIO read request twice with Michael, and the solution proposed was to
> > add a new type of exit to handle this special case.
> > 
> > After working on that solution a bit I saw it's adding a lot of code and
> > complexity for this small issue, and I'm now thinking we may be better
> > off with just handling reads twice in case of a signal just between
> > socket_write() and socket_read() - once through the socket and once
> > through a regular MMIO exit.
> 
> The problem with this approach would be reads with a side-effect though:
> for example, the IRQ status read in virtio clears the status register.
> 
> I don't insist on a new type of exit, just pointing out the problem.

I agree with you, I don't have a better solution either.

I don't feel it's worth it adding so much code for read support to
properly work. Can we do this patch series without socket read support
at the moment?


-- 

Sasha.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux