Linux virtualization list
 help / color / mirror / Atom feed
From: Asias He <asias@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: Virtualization List <virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH 0/2] virtio: console: add locking around control out-vq
Date: Mon, 1 Apr 2013 10:35:53 +0800	[thread overview]
Message-ID: <20130401023553.GC26991@hj.localdomain> (raw)
In-Reply-To: <20130329103500.GC14019@amit.redhat.com>

On Fri, Mar 29, 2013 at 04:05:00PM +0530, Amit Shah wrote:
> On (Fri) 29 Mar 2013 [08:38:49], Asias He wrote:
> > On Thu, Mar 28, 2013 at 04:58:31PM +0530, Amit Shah wrote:
> > > The in-vq operations were protected by a lock, but the out-vq
> > > operations were not.  This caused panics / errors as described in
> > > patch 2.  Fix that.
> > 
> > BTW, this looks suspicious. Why no lock here?
> > 
> >    static void remove_controlq_data(struct ports_device *portdev)
> >    {
> >            struct port_buffer *buf;
> >            unsigned int len;
> >    
> >            if (!use_multiport(portdev))
> >                    return;
> >    
> >            while ((buf = virtqueue_get_buf(portdev->c_ivq, &len)))
> >                    free_buf(buf, true);
> >    
> >            while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq)))
> >                    free_buf(buf, true);
> >    }
> 
> Since this is c_ivq, you mean why can't the host be queueing up data
> in the vq while we're removing the buffers from the vq.
> 
> This function is called from two places, virtcons_remove() and
> virtcons_freeze(). In both the cases, everything is set up so the host
> can't send anything: vdev->config->reset() ensures that.
> 
> Is there something else that can be happening?

OK, this makes sense to me now. Thanks.  

> 		Amit

-- 
Asias

      reply	other threads:[~2013-04-01  2:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 11:28 [PATCH 0/2] virtio: console: add locking around control out-vq Amit Shah
2013-03-28 11:28 ` [PATCH 1/2] virtio: console: rename cvq_lock to c_ivq_lock Amit Shah
2013-03-29  0:30   ` Asias He
2013-03-29  0:56   ` Wanlong Gao
2013-03-28 11:28 ` [PATCH 2/2] virtio: console: add locking around c_ovq operations Amit Shah
2013-03-29  0:29   ` Asias He
2013-03-29 11:00     ` Amit Shah
2013-03-29  0:57   ` Wanlong Gao
2013-03-29 10:39     ` Amit Shah
2013-03-29  0:38 ` [PATCH 0/2] virtio: console: add locking around control out-vq Asias He
2013-03-29 10:35   ` Amit Shah
2013-04-01  2:35     ` Asias He [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130401023553.GC26991@hj.localdomain \
    --to=asias@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox