search for: virtio_disable_featur

Displaying 20 results from an estimated 23 matches for "virtio_disable_featur".

Did you mean: virtio_disable_feature
2014 Nov 13
1
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...virtio_device *dev) > +{ > + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > + } > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_...
2014 Nov 13
1
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...virtio_device *dev) > +{ > + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > + } > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_...
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 18
1
[PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host
...> > However, assuming that we do want this change: > This can be replaced with a table driven design in virtio core, but > since you chose to open code it, I would drop table below altogether. > > > Just make it > if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); > virtio_disable_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE); > virtio_disable_feature(dev, VIRTIO_NET_F_MQ); > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR); > } > This is simila...
2014 Nov 18
1
[PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host
...> > However, assuming that we do want this change: > This can be replaced with a table driven design in virtio core, but > since you chose to open code it, I would drop table below altogether. > > > Just make it > if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); > virtio_disable_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE); > virtio_disable_feature(dev, VIRTIO_NET_F_MQ); > virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR); > } > This is simila...
2014 Nov 13
7
[PATCH 1/2] virito: introduce methods of fixing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 13
7
[PATCH 1/2] virito: introduce methods of fixing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 17
0
[PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host
...ssing what hypervisor wants us to do. However, assuming that we do want this change: This can be replaced with a table driven design in virtio core, but since you chose to open code it, I would drop table below altogether. Just make it if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); virtio_disable_feature(dev, VIRTIO_NET_F_GUEST_ANNOUNCE); virtio_disable_feature(dev, VIRTIO_NET_F_MQ); virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_MAC_ADDR); } > --- > Changes from V1: > - fix...
2014 Nov 17
1
[PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host
...TIO_NET_F_GUEST_ANNOUNCE, + VIRTIO_NET_F_MQ, + VIRTIO_NET_F_CTRL_MAC_ADDR + }; + int i; + + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { + for (i = 0; i < ARRAY_SIZE(features_for_ctrl_vq); i++) { + unsigned int f = features_for_ctrl_vq[i]; + if (virtio_has_feature(dev, f)) { + virtio_disable_feature(dev, f); + dev_warn(&dev->dev, + "buggy hyperviser: disable feature " + "0x%x since VIRTIO_NET_F_CTRL_VQ was " + "not advertised.\n", f); + } + } + } +} + static struct virtio_device_id id_table[] = { { VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID }...
2014 Nov 17
1
[PATCH V3 2/2] virtio-net: sanitize buggy features advertised by host
...TIO_NET_F_GUEST_ANNOUNCE, + VIRTIO_NET_F_MQ, + VIRTIO_NET_F_CTRL_MAC_ADDR + }; + int i; + + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { + for (i = 0; i < ARRAY_SIZE(features_for_ctrl_vq); i++) { + unsigned int f = features_for_ctrl_vq[i]; + if (virtio_has_feature(dev, f)) { + virtio_disable_feature(dev, f); + dev_warn(&dev->dev, + "buggy hyperviser: disable feature " + "0x%x since VIRTIO_NET_F_CTRL_VQ was " + "not advertised.\n", f); + } + } + } +} + static struct virtio_device_id id_table[] = { { VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID }...
2014 Nov 13
0
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...id virtnet_fix_features(struct virtio_device *dev) +{ + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); + } + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); + } + if (virtio...
2014 Nov 13
0
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...id virtnet_fix_features(struct virtio_device *dev) +{ + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); + } + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); + } + if (virtio...
2014 Nov 13
0
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...id virtnet_fix_features(struct virtio_device *dev) +{ + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); + } + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VLAN)) { + pr_warning("Disable VIRTIO_NET_F_CTRL_VLAN since host " + "does not advertise VIRTIO_NET_F_CTRL_VQ"); + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_VLAN); + } + if (virtio...
2014 Nov 17
4
[PATCH V3 1/2] virtio: introduce methods of sanitizing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 17
4
[PATCH V3 1/2] virtio: introduce methods of sanitizing device features
...fig.h b/include/linux/virtio_config.h index 7f4ef66..7bd89ea 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, return test_bit(fbit, vdev->features); } +static inline void virtio_disable_feature(struct virtio_device *vdev, + unsigned int fbit) +{ + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); + BUG_ON(vdev->config->get_status(vdev) & + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)); + + virtio_check_driver_offered_feature...
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
...100644 >> --- a/include/linux/virtio_config.h >> +++ b/include/linux/virtio_config.h >> @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, >> return test_bit(fbit, vdev->features); >> } >> >> +static inline void virtio_disable_feature(struct virtio_device *vdev, >> + unsigned int fbit) >> +{ >> + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); >> + BUG_ON(vdev->config->get_status(vdev) & >> + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIV...
2014 Nov 13
2
[PATCH 1/2] virito: introduce methods of fixing device features
...100644 >> --- a/include/linux/virtio_config.h >> +++ b/include/linux/virtio_config.h >> @@ -96,6 +96,18 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, >> return test_bit(fbit, vdev->features); >> } >> >> +static inline void virtio_disable_feature(struct virtio_device *vdev, >> + unsigned int fbit) >> +{ >> + BUG_ON(fbit >= VIRTIO_TRANSPORT_F_START); >> + BUG_ON(vdev->config->get_status(vdev) & >> + ~(VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIV...
2014 Nov 13
1
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...virtio_device *dev) > +{ > + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > + } You should probably use dev_warn() or so, so that the user can figure out which device the message is for. And perhaps add "buggy hypervisor" to the message to make clear that it's not a guest problem. I also like the suggestion to use a depend...
2014 Nov 13
1
[PATCH 2/2] virtio-net: fix buggy features advertised by host
...virtio_device *dev) > +{ > + if (!virtio_has_feature(dev, VIRTIO_NET_F_CTRL_VQ)) { > + if (virtio_has_feature(dev, VIRTIO_NET_F_CTRL_RX)) { > + pr_warning("Disable VIRTIO_NET_F_CTRL_RX since host " > + "does not advertise VIRTIO_NET_F_CTRL_VQ"); > + virtio_disable_feature(dev, VIRTIO_NET_F_CTRL_RX); > + } You should probably use dev_warn() or so, so that the user can figure out which device the message is for. And perhaps add "buggy hypervisor" to the message to make clear that it's not a guest problem. I also like the suggestion to use a depend...