[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check |
Date: |
Tue, 12 May 2015 15:55:29 +0200 |
On Tue, 12 May 2015 15:14:53 +0200
Cornelia Huck <address@hidden> wrote:
> On Wed, 06 May 2015 14:07:37 +0200
> Greg Kurz <address@hidden> 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 <address@hidden>
> > ---
> > 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
- [Qemu-devel] [PATCH RFC 0/7] vhost: cross-endian support (vhost-net only), Greg Kurz, 2015/05/06
- [Qemu-devel] [PATCH RFC 2/7] linux-headers: sync vhost.h, Greg Kurz, 2015/05/06
- [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Greg Kurz, 2015/05/06
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Michael S. Tsirkin, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Michael S. Tsirkin, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check,
Greg Kurz <=
- Re: [Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check, Peter Maydell, 2015/05/12
[Qemu-devel] [PATCH RFC 3/7] virtio: introduce virtio_legacy_is_cross_endian(), Greg Kurz, 2015/05/06
[Qemu-devel] [PATCH RFC 5/7] tap: add VNET_LE/VNET_BE operations, Greg Kurz, 2015/05/06
[Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Greg Kurz, 2015/05/06
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Michael S. Tsirkin, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Cornelia Huck, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Michael S. Tsirkin, 2015/05/12
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Cornelia Huck, 2015/05/13
- Re: [Qemu-devel] [PATCH RFC 4/7] vhost: set vring endianness for legacy virtio, Michael S. Tsirkin, 2015/05/13