qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check
Date: Tue, 12 May 2015 15:55:29 +0200	[thread overview]
Message-ID: <20150512155529.7e60b47a@bahia.local> (raw)
In-Reply-To: <20150512151453.42880d6c.cornelia.huck@de.ibm.com>

On Tue, 12 May 2015 15:14:53 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> On Wed, 06 May 2015 14:07:37 +0200
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> 
> > Unlike with add and clear, there is no valid reason to abort when checking
> > for a feature. It makes more sense to return false (i.e. the feature bit
> > isn't set). This is exactly what __virtio_has_feature() does if fbit >= 32.
> > 
> > This allows to introduce code that is aware about new 64-bit features like
> > VIRTIO_F_VERSION_1, even if they are still not implemented.
> > 
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > ---
> >  include/hw/virtio/virtio.h |    1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> > index d95f8b6..6ef70f1 100644
> > --- a/include/hw/virtio/virtio.h
> > +++ b/include/hw/virtio/virtio.h
> > @@ -233,7 +233,6 @@ static inline void virtio_clear_feature(uint32_t *features, unsigned int fbit)
> > 
> >  static inline bool __virtio_has_feature(uint32_t features, unsigned int fbit)
> >  {
> > -    assert(fbit < 32);
> >      return !!(features & (1 << fbit));
> >  }
> > 
> > 
> > 
> 
> I must say I'm not very comfortable with knowingly passing out-of-rage
> values to this function.
> 

I take that as a valid reason then :)

> Can we perhaps apply at least the feature-bit-size extending patches
> prior to your patchset, if the remainder of the virtio-1 patchset still
> takes some time?

Hmm... if I remember well, it still lacks migration support.

--
Greg

  parent reply	other threads:[~2015-05-12 14:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 12:07 [Qemu-devel] [PATCH RFC 0/7] vhost: cross-endian support (vhost-net only) Greg Kurz
2015-05-06 12:07 ` [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check Greg Kurz
2015-05-12 13:14   ` Cornelia Huck
2015-05-12 13:34     ` Michael S. Tsirkin
2015-05-12 13:44       ` Cornelia Huck
2015-05-12 14:46         ` Cornelia Huck
2015-05-12 15:30           ` Michael S. Tsirkin
2015-05-12 16:27             ` Cornelia Huck
2015-05-12 13:49     ` Peter Maydell
2015-05-12 13:55     ` Greg Kurz [this message]
2015-05-06 12:07 ` [Qemu-devel] [PATCH RFC 2/7] linux-headers: sync vhost.h Greg Kurz
2015-05-06 12:07 ` [Qemu-devel] [PATCH RFC 3/7] virtio: introduce virtio_legacy_is_cross_endian() Greg Kurz
2015-05-06 12:08 ` [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio Greg Kurz
2015-05-12 13:25   ` Cornelia Huck
2015-05-12 15:15     ` Michael S. Tsirkin
2015-05-12 16:25       ` Cornelia Huck
2015-05-12 16:40         ` Michael S. Tsirkin
2015-05-13 10:39           ` Cornelia Huck
2015-05-13 11:22             ` Michael S. Tsirkin
2015-05-06 12:08 ` [Qemu-devel] [PATCH RFC 5/7] tap: add VNET_LE/VNET_BE operations Greg Kurz
2015-05-06 12:08 ` [Qemu-devel] [PATCH RFC 6/7] vhost-net: tell tap backend about the vnet endianness Greg Kurz
2015-05-06 12:08 ` [Qemu-devel] [PATCH RFC 7/7] vhost_net: re-enable when cross endian Greg Kurz

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=20150512155529.7e60b47a@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).