Lines Matching refs:size

740 static bool vhost_overflow(u64 uaddr, u64 size)
742 if (uaddr > ULONG_MAX || size > ULONG_MAX)
745 if (!size)
748 return uaddr > ULONG_MAX - size + 1;
763 if (vhost_overflow(map->addr, map->size))
767 if (!access_ok((void __user *)a, map->size))
771 map->size))
778 u64 addr, unsigned int size,
819 const void *from, unsigned size)
824 return __copy_to_user(to, from, size);
833 (u64)(uintptr_t)to, size,
837 return __copy_to_user(uaddr, from, size);
839 ret = translate_desc(vq, (u64)(uintptr_t)to, size, vq->iotlb_iov,
844 iov_iter_init(&t, WRITE, vq->iotlb_iov, ret, size);
845 ret = copy_to_iter(from, size, &t);
846 if (ret == size)
854 void __user *from, unsigned size)
859 return __copy_from_user(to, from, size);
867 (u64)(uintptr_t)from, size,
872 return __copy_from_user(to, uaddr, size);
874 ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov,
879 "%p size 0x%llx\n", from,
880 (unsigned long long) size);
883 iov_iter_init(&f, READ, vq->iotlb_iov, ret, size);
884 ret = copy_from_iter(to, size, &f);
885 if (ret == size)
894 void __user *addr, unsigned int size,
899 ret = translate_desc(vq, (u64)(uintptr_t)addr, size, vq->iotlb_iov,
904 "%p size 0x%llx\n", addr,
905 (unsigned long long) size);
909 if (ret != 1 || vq->iotlb_iov[0].iov_len != size) {
911 "%p size 0x%llx\n", addr,
912 (unsigned long long) size);
925 void __user *addr, unsigned int size,
929 (u64)(uintptr_t)addr, size, type);
933 return __vhost_get_user_slow(vq, addr, size, type);
1066 msg->iova + msg->size - 1 >= vq_msg->iova &&
1077 static bool umem_access_ok(u64 uaddr, u64 size, int access)
1082 if (vhost_overflow(uaddr, size))
1086 !access_ok((void __user *)a, size))
1089 !access_ok((void __user *)a, size))
1107 if (!umem_access_ok(msg->uaddr, msg->size, msg->perm)) {
1113 msg->iova + msg->size - 1,
1127 msg->iova + msg->size - 1);
1210 unsigned size = sizeof(struct vhost_msg);
1212 if (iov_iter_count(to) < size)
1248 size = sizeof(node->msg);
1252 size = sizeof(node->msg_v2);
1260 ret = copy_to_iter(start, size, to);
1261 if (ret != size || msg->type != VHOST_IOTLB_MISS) {
1331 u64 s = 0, size, orig_addr = addr, last = addr + len - 1;
1348 size = map->size - addr + map->start;
1350 if (orig_addr == addr && size >= len)
1353 s += size;
1354 addr += size;
1425 unsigned long size = offsetof(struct vhost_memory, regions);
1428 if (copy_from_user(&mem, m, size))
1439 memcpy(newmem, &mem, size);
1535 * If it is not, we don't as size might not have been setup.
1892 u->addr - 1 + u->size < hva)
1895 end = min(u->addr - 1 + u->size, hva - 1 + len);
2057 u64 size;
2077 size = map->size - addr + map->start;
2078 _iov->iov_len = min((u64)len - s, size);
2081 s += size;
2082 addr += size;
2149 "indirect size %u\n",
2282 "vq size %u head %u\n",