search for: fbit

Displaying 20 results from an estimated 157 matches for "fbit".

Did you mean: bit
2014 Nov 27
4
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..249fcd6 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2014 Nov 27
4
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..249fcd6 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2014 Nov 28
0
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ude/linux/virtio_config.h b/include/linux/virtio_config.h > index 7f4ef66..249fcd6 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, > unsigned int fbit); > > /** > - * virtio_has_feature - helper to determine if this device has this feature. > + * __virtio_test_bit - helper to test feature bits. For use by transports. > + * Devices should normally use virtio_has_feature, > + * which inclu...
2014 Nov 28
0
[PATCH v6 01/46] virtio: add low-level APIs for feature bits
...ude/linux/virtio_config.h b/include/linux/virtio_config.h > index 7f4ef66..249fcd6 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, > unsigned int fbit); > > /** > - * virtio_has_feature - helper to determine if this device has this feature. > + * __virtio_test_bit - helper to test feature bits. For use by transports. > + * Devices should normally use virtio_has_feature, > + * which inclu...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d8e28a2 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2014 Dec 01
0
[PATCH v8 01/50] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d8e28a2 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2014 Nov 30
1
[PATCH v7 01/46] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d8e28a2 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2014 Nov 30
1
[PATCH v7 01/46] virtio: add low-level APIs for feature bits
...ons(-) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 7f4ef66..d8e28a2 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -77,11 +77,47 @@ void virtio_check_driver_offered_feature(const struct virtio_device *vdev, unsigned int fbit); /** - * virtio_has_feature - helper to determine if this device has this feature. + * __virtio_test_bit - helper to test feature bits. For use by transports. + * Devices should normally use virtio_has_feature, + * which includes more checks. * @vdev: t...
2015 May 12
4
[Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check
...14:07:37 +0200 Greg Kurz <gkurz at 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 at linux.vnet.ibm.com> > --- > include/hw/virtio/virtio.h | 1 - > 1 file ch...
2015 May 12
4
[Qemu-devel] [PATCH RFC 1/7] virtio: relax feature check
...14:07:37 +0200 Greg Kurz <gkurz at 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 at linux.vnet.ibm.com> > --- > include/hw/virtio/virtio.h | 1 - > 1 file ch...
2014 Nov 30
0
[PATCH v7 04/46] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Dec 01
0
[PATCH v8 04/50] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Nov 30
0
[PATCH v7 04/46] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Dec 01
0
[PATCH v8 04/50] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Nov 27
2
[PATCH v6 04/46] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Nov 27
2
[PATCH v6 04/46] virtio: add support for 64 bit features.
...*vdev); const char *(*bus_name)(struct virtio_device *vdev); int (*set_vq_affinity)(struct virtqueue *vq, int cpu); @@ -88,11 +88,11 @@ static inline bool __virtio_test_bit(const struct virtio_device *vdev, { /* Did you forget to fix assumptions on max features? */ if (__builtin_constant_p(fbit)) - BUILD_BUG_ON(fbit >= 32); + BUILD_BUG_ON(fbit >= 64); else - BUG_ON(fbit >= 32); + BUG_ON(fbit >= 64); - return vdev->features & BIT(fbit); + return vdev->features & BIT_ULL(fbit); } /** @@ -105,11 +105,11 @@ static inline void __virtio_set_bit(struct virti...
2014 Dec 11
3
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...T_REMOVED); ... > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index 2fede2e..f6c0379 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -278,6 +278,17 @@ static inline void virtio_clear_feature(uint32_t *features, unsigned int fbit) > *features &= ~(1 << fbit); > } > > +static inline bool __virtio_has_feature(uint32_t features, unsigned int fbit) > +{ > + assert(fbit < 32); > + return !!(features & (1 << fbit)); > +} > + > +static inline bool virtio_has_feature...
2014 Dec 11
3
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...T_REMOVED); ... > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index 2fede2e..f6c0379 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -278,6 +278,17 @@ static inline void virtio_clear_feature(uint32_t *features, unsigned int fbit) > *features &= ~(1 << fbit); > } > > +static inline bool __virtio_has_feature(uint32_t features, unsigned int fbit) > +{ > + assert(fbit < 32); > + return !!(features & (1 << fbit)); > +} > + > +static inline bool virtio_has_feature...
2014 Nov 20
2
[PATCH net V3] virtio-net: validate features during probe
...rs/net/virtio_net.c index ec2a8b4..a6bcfce 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1673,6 +1673,40 @@ static const struct attribute_group virtio_net_mrg_rx_group = { }; #endif +static bool virtnet_fail_on_feature(struct virtio_device *vdev, + unsigned int fbit, + const char *fname, const char *dname) +{ + if (!virtio_has_feature(vdev, fbit)) + return false; + + dev_err(&vdev->dev, "Hypervisor bug: advertise feature %s but not %s", + fname, dname); + + return true; +} + +#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \ + virtnet_fai...
2014 Nov 20
2
[PATCH net V3] virtio-net: validate features during probe
...rs/net/virtio_net.c index ec2a8b4..a6bcfce 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1673,6 +1673,40 @@ static const struct attribute_group virtio_net_mrg_rx_group = { }; #endif +static bool virtnet_fail_on_feature(struct virtio_device *vdev, + unsigned int fbit, + const char *fname, const char *dname) +{ + if (!virtio_has_feature(vdev, fbit)) + return false; + + dev_err(&vdev->dev, "Hypervisor bug: advertise feature %s but not %s", + fname, dname); + + return true; +} + +#define VIRTNET_FAIL_ON(vdev, fbit, dbit) \ + virtnet_fai...