search for: vq_err

Displaying 20 results from an estimated 563 matches for "vq_err".

2017 May 22
1
[PATCH] vhost: Coalesce vq_err formats, pr_fmt misuse, add missing newlines
vhost logging uses of vq_err has a few defects and style inconsistencies. o pr_debug already uses pr_fmt so its use in vq_err is defective however no #defines of pr_fmt exist in this code so no actual defects exist o vq_err uses need terminating newlines so add the missing ones o Coalesce formats and realign arguments Si...
2017 May 22
1
[PATCH] vhost: Coalesce vq_err formats, pr_fmt misuse, add missing newlines
vhost logging uses of vq_err has a few defects and style inconsistencies. o pr_debug already uses pr_fmt so its use in vq_err is defective however no #defines of pr_fmt exist in this code so no actual defects exist o vq_err uses need terminating newlines so add the missing ones o Coalesce formats and realign arguments Si...
2020 Jun 03
1
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...; + struct vring_desc desc; >>> + unsigned int i = 0, count, found = 0; >>> + u32 len = indirect->len; >>> + struct iov_iter from; >>> + int ret; >>> + >>> + /* Sanity check */ >>> + if (unlikely(len % sizeof desc)) { >>> + vq_err(vq, "Invalid length in indirect descriptor: " >>> + "len 0x%llx not multiple of 0x%zx\n", >>> + (unsigned long long)len, >>> + sizeof desc); >>> + return -EINVAL; >>> + } >>> + >>> + ret = tr...
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...struct vhost_desc *indirect, > + u16 head) > +{ > + struct vring_desc desc; > + unsigned int i = 0, count, found = 0; > + u32 len = indirect->len; > + struct iov_iter from; > + int ret; > + > + /* Sanity check */ > + if (unlikely(len % sizeof desc)) { > + vq_err(vq, "Invalid length in indirect descriptor: " > + "len 0x%llx not multiple of 0x%zx\n", > + (unsigned long long)len, > + sizeof desc); > + return -EINVAL; > + } > + > + ret = translate_desc(vq, indirect->addr, len, vq->indirect...
2020 Jun 03
2
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...struct vhost_desc *indirect, > + u16 head) > +{ > + struct vring_desc desc; > + unsigned int i = 0, count, found = 0; > + u32 len = indirect->len; > + struct iov_iter from; > + int ret; > + > + /* Sanity check */ > + if (unlikely(len % sizeof desc)) { > + vq_err(vq, "Invalid length in indirect descriptor: " > + "len 0x%llx not multiple of 0x%zx\n", > + (unsigned long long)len, > + sizeof desc); > + return -EINVAL; > + } > + > + ret = translate_desc(vq, indirect->addr, len, vq->indirect...
2020 Apr 07
0
[PATCH v7 18/19] vhost: use batched version by default
...ct vhost_log *log, unsigned int *log_num, - struct vring_desc *indirect) -{ - struct vring_desc desc; - unsigned int i = 0, count, found = 0; - u32 len = vhost32_to_cpu(vq, indirect->len); - struct iov_iter from; - int ret, access; - - /* Sanity check */ - if (unlikely(len % sizeof desc)) { - vq_err(vq, "Invalid length in indirect descriptor: " - "len 0x%llx not multiple of 0x%zx\n", - (unsigned long long)len, - sizeof desc); - return -EINVAL; - } - - ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr), len, vq->indirect, - UIO_...
2020 Apr 07
0
[PATCH v8 18/19] vhost: use batched version by default
...ct vhost_log *log, unsigned int *log_num, - struct vring_desc *indirect) -{ - struct vring_desc desc; - unsigned int i = 0, count, found = 0; - u32 len = vhost32_to_cpu(vq, indirect->len); - struct iov_iter from; - int ret, access; - - /* Sanity check */ - if (unlikely(len % sizeof desc)) { - vq_err(vq, "Invalid length in indirect descriptor: " - "len 0x%llx not multiple of 0x%zx\n", - (unsigned long long)len, - sizeof desc); - return -EINVAL; - } - - ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr), len, vq->indirect, - UIO_...
2020 Jun 02
0
[PATCH RFC 02/13] vhost: use batched version by default
...ct vhost_log *log, unsigned int *log_num, - struct vring_desc *indirect) -{ - struct vring_desc desc; - unsigned int i = 0, count, found = 0; - u32 len = vhost32_to_cpu(vq, indirect->len); - struct iov_iter from; - int ret, access; - - /* Sanity check */ - if (unlikely(len % sizeof desc)) { - vq_err(vq, "Invalid length in indirect descriptor: " - "len 0x%llx not multiple of 0x%zx\n", - (unsigned long long)len, - sizeof desc); - return -EINVAL; - } - - ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr), len, vq->indirect, - UIO_...
2014 Nov 30
3
[PATCH v7 31/46] vhost: virtio 1.0 endian-ness support
...9 @@ static int get_indirect(struct vhost_virtqueue *vq, { struct vring_desc desc; unsigned int i = 0, count, found = 0; + u32 len = vhost32_to_cpu(vq, indirect->len); int ret; /* Sanity check */ - if (unlikely(indirect->len % sizeof desc)) { + if (unlikely(len % sizeof desc)) { vq_err(vq, "Invalid length in indirect descriptor: " "len 0x%llx not multiple of 0x%zx\n", - (unsigned long long)indirect->len, + (unsigned long long)vhost32_to_cpu(vq, indirect->len), sizeof desc); return -EINVAL; } - ret = translate_de...
2014 Nov 30
3
[PATCH v7 31/46] vhost: virtio 1.0 endian-ness support
...9 @@ static int get_indirect(struct vhost_virtqueue *vq, { struct vring_desc desc; unsigned int i = 0, count, found = 0; + u32 len = vhost32_to_cpu(vq, indirect->len); int ret; /* Sanity check */ - if (unlikely(indirect->len % sizeof desc)) { + if (unlikely(len % sizeof desc)) { vq_err(vq, "Invalid length in indirect descriptor: " "len 0x%llx not multiple of 0x%zx\n", - (unsigned long long)indirect->len, + (unsigned long long)vhost32_to_cpu(vq, indirect->len), sizeof desc); return -EINVAL; } - ret = translate_de...
2020 Jun 02
0
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...int fetch_indirect_descs(struct vhost_virtqueue *vq, + struct vhost_desc *indirect, + u16 head) +{ + struct vring_desc desc; + unsigned int i = 0, count, found = 0; + u32 len = indirect->len; + struct iov_iter from; + int ret; + + /* Sanity check */ + if (unlikely(len % sizeof desc)) { + vq_err(vq, "Invalid length in indirect descriptor: " + "len 0x%llx not multiple of 0x%zx\n", + (unsigned long long)len, + sizeof desc); + return -EINVAL; + } + + ret = translate_desc(vq, indirect->addr, len, vq->indirect, + UIO_MAXIOV, VHOST_ACCESS...
2020 Apr 07
0
[PATCH v7 17/19] vhost: option to fetch descriptors through an independent struct
...int fetch_indirect_descs(struct vhost_virtqueue *vq, + struct vhost_desc *indirect, + u16 head) +{ + struct vring_desc desc; + unsigned int i = 0, count, found = 0; + u32 len = indirect->len; + struct iov_iter from; + int ret; + + /* Sanity check */ + if (unlikely(len % sizeof desc)) { + vq_err(vq, "Invalid length in indirect descriptor: " + "len 0x%llx not multiple of 0x%zx\n", + (unsigned long long)len, + sizeof desc); + return -EINVAL; + } + + ret = translate_desc(vq, indirect->addr, len, vq->indirect, + UIO_MAXIOV, VHOST_ACCESS...
2020 Apr 07
0
[PATCH v8 17/19] vhost: option to fetch descriptors through an independent struct
...int fetch_indirect_descs(struct vhost_virtqueue *vq, + struct vhost_desc *indirect, + u16 head) +{ + struct vring_desc desc; + unsigned int i = 0, count, found = 0; + u32 len = indirect->len; + struct iov_iter from; + int ret; + + /* Sanity check */ + if (unlikely(len % sizeof desc)) { + vq_err(vq, "Invalid length in indirect descriptor: " + "len 0x%llx not multiple of 0x%zx\n", + (unsigned long long)len, + sizeof desc); + return -EINVAL; + } + + ret = translate_desc(vq, indirect->addr, len, vq->indirect, + UIO_MAXIOV, VHOST_ACCESS...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...ct vring_desc *indirect) > -{ > - struct vring_desc desc; > - unsigned int i = 0, count, found = 0; > - u32 len = vhost32_to_cpu(vq, indirect->len); > - struct iov_iter from; > - int ret, access; > - > - /* Sanity check */ > - if (unlikely(len % sizeof desc)) { > - vq_err(vq, "Invalid length in indirect descriptor: " > - "len 0x%llx not multiple of 0x%zx\n", > - (unsigned long long)len, > - sizeof desc); > - return -EINVAL; > - } > - > - ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr),...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...ct vring_desc *indirect) > -{ > - struct vring_desc desc; > - unsigned int i = 0, count, found = 0; > - u32 len = vhost32_to_cpu(vq, indirect->len); > - struct iov_iter from; > - int ret, access; > - > - /* Sanity check */ > - if (unlikely(len % sizeof desc)) { > - vq_err(vq, "Invalid length in indirect descriptor: " > - "len 0x%llx not multiple of 0x%zx\n", > - (unsigned long long)len, > - sizeof desc); > - return -EINVAL; > - } > - > - ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr),...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...> void __user *used; > @@ -1895,7 +1958,7 @@ int vhost_vq_init_access(struct vhost_virtqueue *vq) > r = -EFAULT; > goto err; > } > - r = vhost_get_used(vq, last_used_idx, &vq->used->idx); > + r = vhost_get_used_idx(vq, &last_used_idx); > if (r) { > vq_err(vq, "Can't access used idx at %p\n", > &vq->used->idx); From the error case, it looks like you are not entirely encapsulating knowledge of what the accessor uses, i.e. it?s not: vq_err(vq, "Can't access used idx at %p\n", &last_user...
2019 Mar 06
1
[RFC PATCH V2 2/5] vhost: fine grain userspace memory accessors
...> void __user *used; > @@ -1895,7 +1958,7 @@ int vhost_vq_init_access(struct vhost_virtqueue *vq) > r = -EFAULT; > goto err; > } > - r = vhost_get_used(vq, last_used_idx, &vq->used->idx); > + r = vhost_get_used_idx(vq, &last_used_idx); > if (r) { > vq_err(vq, "Can't access used idx at %p\n", > &vq->used->idx); From the error case, it looks like you are not entirely encapsulating knowledge of what the accessor uses, i.e. it?s not: vq_err(vq, "Can't access used idx at %p\n", &last_user...
2020 Jun 03
0
[PATCH RFC 01/13] vhost: option to fetch descriptors through an independent struct
...d) > > +{ > > + struct vring_desc desc; > > + unsigned int i = 0, count, found = 0; > > + u32 len = indirect->len; > > + struct iov_iter from; > > + int ret; > > + > > + /* Sanity check */ > > + if (unlikely(len % sizeof desc)) { > > + vq_err(vq, "Invalid length in indirect descriptor: " > > + "len 0x%llx not multiple of 0x%zx\n", > > + (unsigned long long)len, > > + sizeof desc); > > + return -EINVAL; > > + } > > + > > + ret = translate_desc(vq, indi...
2019 Oct 11
0
[PATCH RFC v1 1/2] vhost: option to fetch descriptors through an independent struct
...int fetch_indirect_descs(struct vhost_virtqueue *vq, + struct vhost_desc *indirect, + u16 head) +{ + struct vring_desc desc; + unsigned int i = 0, count, found = 0; + u32 len = indirect->len; + struct iov_iter from; + int ret; + + /* Sanity check */ + if (unlikely(len % sizeof desc)) { + vq_err(vq, "Invalid length in indirect descriptor: " + "len 0x%llx not multiple of 0x%zx\n", + (unsigned long long)len, + sizeof desc); + return -EINVAL; + } + + ret = translate_desc(vq, indirect->addr, len, vq->indirect, + UIO_MAXIOV, VHOST_ACCESS...
2010 Jun 27
1
[PATCH] vhost: break out of polling loop on error
...d int *in_num, + struct vhost_log *log, unsigned int *log_num) { struct vring_desc desc; unsigned int i, head, found = 0; @@ -890,13 +891,13 @@ unsigned vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq, if (get_user(vq->avail_idx, &vq->avail->idx)) { vq_err(vq, "Failed to access avail idx at %p\n", &vq->avail->idx); - return vq->num; + return -EFAULT; } if ((u16)(vq->avail_idx - last_avail_idx) > vq->num) { vq_err(vq, "Guest moved used index from %u to %u", last_avail_idx, vq-&gt...