qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] dataplane: endian fix in host notification


From: Greg Kurz
Subject: Re: [Qemu-devel] [PATCH] dataplane: endian fix in host notification
Date: Thu, 25 Jun 2015 22:06:02 +0200

On Thu, 25 Jun 2015 18:41:31 +0200
Cornelia Huck <address@hidden> wrote:

> On Thu, 25 Jun 2015 18:34:47 +0200
> Cornelia Huck <address@hidden> wrote:
> 
> > On Thu, 25 Jun 2015 17:26:21 +0200
> > Greg Kurz <address@hidden> wrote:
> > 
> > > This field comes either LE with virtio 1.0, either guest endian with 
> > > legacy.
> > > It must only be accessed with an accessor that knows about the appropriate
> > > endianness.
> > > 
> > > Signed-off-by: Greg Kurz <address@hidden>
> > > ---
> > >  hw/virtio/dataplane/vring.c |    2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
> > > index 3fa421b9d773..a93ee2d338d7 100644
> > > --- a/hw/virtio/dataplane/vring.c
> > > +++ b/hw/virtio/dataplane/vring.c
> > > @@ -117,7 +117,7 @@ void vring_disable_notification(VirtIODevice *vdev, 
> > > Vring *vring)
> > >  bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)
> > >  {
> > >      if (virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
> > > -        vring_avail_event(&vring->vr) = vring->vr.avail->idx;
> > > +        vring_avail_event(&vring->vr) = vring_get_avail_idx(vdev, vring);
> > >      } else {
> > >          vring_clear_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);
> > >      }
> > > 
> > Hm... we should publish in the same endianness as the queue, shouldn't
> > we? IOW, this seems fine.
> 
> Er, by this I mean "it is fine without your patch". Long day...
> 

Heh your OTOH comment below made it quite clear about what "seems fine".

Thanks for this clarification anyway :)

> > 
> > OTOH, this prompted me to check for other places where we touch
> > vring_avail_event and it seems to me that we need to convert
> > vring->last_avail_idx before we set it in vring_pop().
> > 
> > I might be confused, though :)
> > 
> > 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]