1
0
Fork 0

vhost: copy_from_user -> __copy_from_user

copy_from_user is pretty high on perf top profile,
replacing it with __copy_from_user helps.
It's also safe because we do access_ok checks during setup.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hifive-unleashed-5.1
Michael S. Tsirkin 2011-03-06 13:33:49 +02:00
parent d47effe1be
commit fcc042a280
1 changed files with 1 additions and 1 deletions

View File

@ -1171,7 +1171,7 @@ int vhost_get_vq_desc(struct vhost_dev *dev, struct vhost_virtqueue *vq,
i, vq->num, head);
return -EINVAL;
}
ret = copy_from_user(&desc, vq->desc + i, sizeof desc);
ret = __copy_from_user(&desc, vq->desc + i, sizeof desc);
if (unlikely(ret)) {
vq_err(vq, "Failed to get descriptor: idx %d addr %p\n",
i, vq->desc + i);