Re: [PATCH] virtio: Decrement avail idx on buffer detach

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

 



On (Thu) 17 Mar 2011 [17:56:59], Amit Shah wrote:
> On (Thu) 17 Mar 2011 [15:26:28], Rusty Russell wrote:
> > On Wed, 16 Mar 2011 19:12:10 +0530, Amit Shah <amit.shah@xxxxxxxxxx> wrote:
> > > When detaching a buffer from a vq, the avail.idx value should be
> > > decremented as well.
> > > 
> > > This was noticed by hot-unplugging a virtio console port and then
> > > plugging in a new one on the same number (re-using the vqs which were
> > > just 'disowned').  qemu reported
> > > 
> > >    'Guest moved used index from 0 to 256'
> > > 
> > > when any IO was attempted on the new port.
> > 
> > Yech... detach_unused_buf cannot be used on a live virtqueue; it assumes
> > we will reset the vq (usually by resetting the entire device).
> > 
> > You've partially violated that assumption by reusing the vq after
> > calling detach_unused_buf.  So I'm not entirely sure this is the only
> > bug lurking; safer would be to re-initialize the vq somehow when you
> > plug back in...
> 
> Right; and then that will need host changes too (re-init the vqs on
> the host side), which then gets us into compat problems...

Rusty, any thoughts on this?

		Amit
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux