qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] virtio: update queue size on guest write
Date: Mon, 16 Dec 2019 05:52:58 -0500	[thread overview]
Message-ID: <20191216055229-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20191216085013.q7tgbesniil3nmbq@steredhat>

On Mon, Dec 16, 2019 at 09:50:13AM +0100, Stefano Garzarella wrote:
> On Fri, Dec 13, 2019 at 09:24:03AM -0500, Michael S. Tsirkin wrote:
> > Some guests read back queue size after writing it.
> > Update the size immediatly upon write otherwise
> > they get confused.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  hw/virtio/virtio-pci.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
> 
> 
> Just a question, should we do the same in virtio-mmio?
> 
> Maybe doing virtio_queue_set_num() in any case (legacy and non-legacy)
> during VIRTIO_MMIO_QUEUE_NUM writing.
> 
> Thanks,
> Stefano

I guess it makes sense ...

> > 
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index c6b47a9c73..e5c759e19e 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -1256,6 +1256,8 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
> >          break;
> >      case VIRTIO_PCI_COMMON_Q_SIZE:
> >          proxy->vqs[vdev->queue_sel].num = val;
> > +        virtio_queue_set_num(vdev, vdev->queue_sel,
> > +                             proxy->vqs[vdev->queue_sel].num);
> >          break;
> >      case VIRTIO_PCI_COMMON_Q_MSIX:
> >          msix_vector_unuse(&proxy->pci_dev,
> > -- 
> > MST
> > 
> > 
> 
> -- 



      reply	other threads:[~2019-12-16 10:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 14:24 [PATCH] virtio: update queue size on guest write Michael S. Tsirkin
2019-12-16  8:50 ` Stefano Garzarella
2019-12-16 10:52   ` Michael S. Tsirkin [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=20191216055229-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).