Lines Matching defs:size

1014 static bool vhost_overflow(u64 uaddr, u64 size)
1016 if (uaddr > ULONG_MAX || size > ULONG_MAX)
1019 if (!size)
1022 return uaddr > ULONG_MAX - size + 1;
1037 if (vhost_overflow(map->addr, map->size))
1041 if (!access_ok((void __user *)a, map->size))
1045 map->size))
1052 u64 addr, unsigned int size,
1093 const void *from, unsigned size)
1098 return __copy_to_user(to, from, size);
1107 (u64)(uintptr_t)to, size,
1111 return __copy_to_user(uaddr, from, size);
1113 ret = translate_desc(vq, (u64)(uintptr_t)to, size, vq->iotlb_iov,
1118 iov_iter_init(&t, ITER_DEST, vq->iotlb_iov, ret, size);
1119 ret = copy_to_iter(from, size, &t);
1120 if (ret == size)
1128 void __user *from, unsigned size)
1133 return __copy_from_user(to, from, size);
1141 (u64)(uintptr_t)from, size,
1146 return __copy_from_user(to, uaddr, size);
1148 ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov,
1153 "%p size 0x%llx\n", from,
1154 (unsigned long long) size);
1157 iov_iter_init(&f, ITER_SOURCE, vq->iotlb_iov, ret, size);
1158 ret = copy_from_iter(to, size, &f);
1159 if (ret == size)
1168 void __user *addr, unsigned int size,
1173 ret = translate_desc(vq, (u64)(uintptr_t)addr, size, vq->iotlb_iov,
1178 "%p size 0x%llx\n", addr,
1179 (unsigned long long) size);
1183 if (ret != 1 || vq->iotlb_iov[0].iov_len != size) {
1185 "%p size 0x%llx\n", addr,
1186 (unsigned long long) size);
1199 void __user *addr, unsigned int size,
1203 (u64)(uintptr_t)addr, size, type);
1207 return __vhost_get_user_slow(vq, addr, size, type);
1340 msg->iova + msg->size - 1 >= vq_msg->iova &&
1351 static bool umem_access_ok(u64 uaddr, u64 size, int access)
1356 if (vhost_overflow(uaddr, size))
1360 !access_ok((void __user *)a, size))
1363 !access_ok((void __user *)a, size))
1384 if (!umem_access_ok(msg->uaddr, msg->size, msg->perm)) {
1390 msg->iova + msg->size - 1,
1404 msg->iova + msg->size - 1);
1461 if (msg.type == VHOST_IOTLB_UPDATE && msg.size == 0) {
1502 unsigned size = sizeof(struct vhost_msg);
1504 if (iov_iter_count(to) < size)
1540 size = sizeof(node->msg);
1544 size = sizeof(node->msg_v2);
1552 ret = copy_to_iter(start, size, to);
1553 if (ret != size || msg->type != VHOST_IOTLB_MISS) {
1623 u64 s = 0, size, orig_addr = addr, last = addr + len - 1;
1640 size = map->size - addr + map->start;
1642 if (orig_addr == addr && size >= len)
1645 s += size;
1646 addr += size;
1717 unsigned long size = offsetof(struct vhost_memory, regions);
1720 if (copy_from_user(&mem, m, size))
1731 memcpy(newmem, &mem, size);
1827 * If it is not, we don't as size might not have been setup.
2178 u->addr - 1 + u->size < hva)
2181 end = min(u->addr - 1 + u->size, hva - 1 + len);
2343 u64 size;
2363 size = map->size - addr + map->start;
2364 _iov->iov_len = min((u64)len - s, size);
2367 s += size;
2368 addr += size;
2435 "indirect size %u\n",
2568 "vq size %u head %u\n",