Displaying 20 results from an estimated 154 matches for "virtio_cread_featur".
Did you mean:
virtio_cread_feature
2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...;
if (ret)
return ret;
@@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev)
goto err_free_vqs;
}
- viommu->domain_bits = 32;
+ viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
+ viommu->last_domain = ~0U;
/* Optional features */
virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
@@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev)
struct virtio_iommu_config, input_range.end,
&input_end);
- virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
- struct virtio_iommu_config, domain_bits,...
2019 Jul 22
3
[PATCH] iommu/virtio: Update to most recent specification
...;
if (ret)
return ret;
@@ -1027,7 +1036,8 @@ static int viommu_probe(struct virtio_device *vdev)
goto err_free_vqs;
}
- viommu->domain_bits = 32;
+ viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
+ viommu->last_domain = ~0U;
/* Optional features */
virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
@@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev)
struct virtio_iommu_config, input_range.end,
&input_end);
- virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
- struct virtio_iommu_config, domain_bits,...
2020 Aug 05
0
[PATCH v3 36/38] virtio-iommu: convert to LE accessors
...);
+ virtio_cread_le(vdev, struct virtio_iommu_config, page_size_mask,
+ &viommu->pgsize_bitmap);
if (!viommu->pgsize_bitmap) {
ret = -EINVAL;
@@ -1022,25 +1022,25 @@ static int viommu_probe(struct virtio_device *vdev)
viommu->last_domain = ~0U;
/* Optional features */
- virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
- struct virtio_iommu_config, input_range.start,
- &input_start);
+ virtio_cread_le_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
+ struct virtio_iommu_config, input_range.start,
+ &input_start);
- virtio_cread_feature(vdev, VIRTIO_IOMMU_...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...8 @@ static int viommu_probe(struct virtio_device *vdev)
> goto err_free_vqs;
> }
>
> - viommu->domain_bits = 32;
> + viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
> + viommu->last_domain = ~0U;
>
> /* Optional features */
> virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
> @@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev)
> struct virtio_iommu_config, input_range.end,
> &input_end);
>
> - virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
> - struct virt...
2019 Jul 22
0
[PATCH] iommu/virtio: Update to most recent specification
...8 @@ static int viommu_probe(struct virtio_device *vdev)
> goto err_free_vqs;
> }
>
> - viommu->domain_bits = 32;
> + viommu->map_flags = VIRTIO_IOMMU_MAP_F_READ | VIRTIO_IOMMU_MAP_F_WRITE;
> + viommu->last_domain = ~0U;
>
> /* Optional features */
> virtio_cread_feature(vdev, VIRTIO_IOMMU_F_INPUT_RANGE,
> @@ -1038,9 +1048,13 @@ static int viommu_probe(struct virtio_device *vdev)
> struct virtio_iommu_config, input_range.end,
> &input_end);
>
> - virtio_cread_feature(vdev, VIRTIO_IOMMU_F_DOMAIN_BITS,
> - struct virt...
2023 May 10
3
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...to describe the length of
a descriptor: see struct vring_desc and struct vring_packed_desc.
This means the max segment size supported by virtio is U32_MAX.
An example of virtio_max_dma_size in virtio_blk.c:
u32 v, max_size;
max_size = virtio_max_dma_size(vdev); -> implicit convert
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX,
struct virtio_blk_config, size_max, &v);
max_size = min(max_size, v);
There is a risk during implicit convert here, once virtio_max_dma_size
returns 4G, max_size becomes 0.
Fixes: e6d6dd6c875e ("virtio: Introduce virtio_max_dma...
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...k_size(unsigned int blksize)
+{
+ return blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk_valid_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: unsupported logical block size %d\n",
+ __func__, blk_size);
+ er...
2020 Jul 15
3
[PATCH] virtio-blk: check host supplied logical block size
...k_size(unsigned int blksize)
+{
+ return blksize >= 512 && blksize <= PAGE_SIZE && is_power_of_2(blksize);
+}
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!virtblk_valid_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: unsupported logical block size %d\n",
+ __func__, blk_size);
+ er...
2014 Nov 19
2
[PATCH net] virtio-net: validate features during probe
...e(struct virtio_device *vdev)
>> struct virtnet_info *vi;
>> u16 max_queue_pairs;
>>
>> + err = virtnet_check_features(vdev);
>> + if (err)
>> + return -EINVAL;
>> +
>> /* Find if host supports multiqueue virtio_net device */
>> err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ,
>> struct virtio_net_config,
> The API seems too complex, and you still had to open-code ECN logic.
> Just open-code most of it.
Yes, the ECN could be done through the same way as ctrl_vq did.
How about move those checking into virtio core by just lett...
2014 Nov 19
2
[PATCH net] virtio-net: validate features during probe
...e(struct virtio_device *vdev)
>> struct virtnet_info *vi;
>> u16 max_queue_pairs;
>>
>> + err = virtnet_check_features(vdev);
>> + if (err)
>> + return -EINVAL;
>> +
>> /* Find if host supports multiqueue virtio_net device */
>> err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ,
>> struct virtio_net_config,
> The API seems too complex, and you still had to open-code ECN logic.
> Just open-code most of it.
Yes, the ECN could be done through the same way as ctrl_vq did.
How about move those checking into virtio core by just lett...
2014 Nov 19
4
[PATCH net] virtio-net: validate features during probe
...tio_device *vdev)
{
int i, err;
@@ -1680,6 +1769,10 @@ static int virtnet_probe(struct virtio_device *vdev)
struct virtnet_info *vi;
u16 max_queue_pairs;
+ err = virtnet_check_features(vdev);
+ if (err)
+ return -EINVAL;
+
/* Find if host supports multiqueue virtio_net device */
err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ,
struct virtio_net_config,
--
1.9.1
2014 Nov 19
4
[PATCH net] virtio-net: validate features during probe
...tio_device *vdev)
{
int i, err;
@@ -1680,6 +1769,10 @@ static int virtnet_probe(struct virtio_device *vdev)
struct virtnet_info *vi;
u16 max_queue_pairs;
+ err = virtnet_check_features(vdev);
+ if (err)
+ return -EINVAL;
+
/* Find if host supports multiqueue virtio_net device */
err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ,
struct virtio_net_config,
--
1.9.1
2023 May 10
2
[PATCH] virtio_ring: use u32 for virtio_max_dma_size
...iptor: see struct vring_desc and struct vring_packed_desc.
> This means the max segment size supported by virtio is U32_MAX.
>
> An example of virtio_max_dma_size in virtio_blk.c:
> u32 v, max_size;
>
> max_size = virtio_max_dma_size(vdev); -> implicit convert
> err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX,
> struct virtio_blk_config, size_max, &v);
> max_size = min(max_size, v);
>
> There is a risk during implicit convert here, once virtio_max_dma_size
> returns 4G, max_size becomes 0.
>
> Fixes: e6d6dd6c875e ("...
2019 Feb 07
0
[PATCH v7 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size
...alignment_offset;
@@ -826,14 +826,16 @@ static int virtblk_probe(struct virtio_device *vdev)
/* No real sector limit. */
blk_queue_max_hw_sectors(q, -1U);
+ max_size = virtio_max_dma_size(vdev);
+
/* Host can optionally specify maximum segment size and number of
* segments. */
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX,
struct virtio_blk_config, size_max, &v);
if (!err)
- blk_queue_max_segment_size(q, v);
- else
- blk_queue_max_segment_size(q, -1U);
+ max_size = min(max_size, v);
+
+ blk_queue_max_segment_size(q, max_size);
/* Host can optionally specify the block...
2020 Jul 21
0
[PATCH 02/10] block: virtio-blk: check logical block size
...nged, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 980df853ee497..b5ee87cba00ed 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -809,10 +809,18 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size,
&blk_size);
- if (!err)
+ if (!err) {
+ if (!blk_is_valid_logical_block_size(blk_size)) {
+ dev_err(&vdev->dev,
+ "%s failure: invalid logical block size %d\n",
+ __func__, blk_size);
+...
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...fixing all of them but I am a bit afraid to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
> > &blk_size);
> > - if (!err)
> > + if (!err) {
> > + if (!virtblk_valid_block_size(blk_size)) {
> > + dev_err(&vdev->dev,
> > + "%s failure: unsup...
2020 Jul 15
2
[PATCH] virtio-blk: check host supplied logical block size
...fixing all of them but I am a bit afraid to create
too much mess.
>
> > static int virtblk_probe(struct virtio_device *vdev)
> > {
> > struct virtio_blk *vblk;
> > @@ -809,9 +815,16 @@ static int virtblk_probe(struct virtio_device
> > *vdev)
> > err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
> > struct virtio_blk_config, blk_size,
> > &blk_size);
> > - if (!err)
> > + if (!err) {
> > + if (!virtblk_valid_block_size(blk_size)) {
> > + dev_err(&vdev->dev,
> > + "%s failure: unsup...
2014 Jun 13
6
[RFC PATCH 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
This patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance problems on
virtio-blk device get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq
2014 Jun 13
6
[RFC PATCH 0/2] block: virtio-blk: support multi vq per virtio-blk
Hi,
This patches try to support multi virtual queues(multi-vq) in one
virtio-blk device, and maps each virtual queue(vq) to blk-mq's
hardware queue.
With this approach, both scalability and performance problems on
virtio-blk device get improved.
For verifying the improvement, I implements virtio-blk multi-vq over
qemu's dataplane feature, and both handling host notification
from each vq
2016 Feb 24
1
[PATCH v2] virtio_blk: VIRTIO_BLK_F_WCE->VIRTIO_BLK_F_FLUSH
...endif
#endif /* !VIRTIO_BLK_NO_LEGACY */
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 6ca3549..28cff0d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -477,8 +477,13 @@ static int virtblk_get_cache_mode(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_CONFIG_WCE,
struct virtio_blk_config, wce,
&writeback);
+
+ /*
+ * If WCE is not configurable and flush is not available,
+ * assume no writeback cache is in use.
+ */
if (err)
- writeback = virtio_has_feature(vdev, VIRTIO_BLK_F_WCE);
+ writeback = vir...