diff options
Diffstat (limited to 'drivers/vhost/vhost.c')
-rw-r--r-- | drivers/vhost/vhost.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e69d238c5af0..5c9c657ab753 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -715,8 +715,8 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, | |||
715 | return 0; | 715 | return 0; |
716 | } | 716 | } |
717 | 717 | ||
718 | int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, | 718 | static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, |
719 | struct iovec iov[], int iov_size) | 719 | struct iovec iov[], int iov_size) |
720 | { | 720 | { |
721 | const struct vhost_memory_region *reg; | 721 | const struct vhost_memory_region *reg; |
722 | struct vhost_memory *mem; | 722 | struct vhost_memory *mem; |
@@ -741,7 +741,7 @@ int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, | |||
741 | _iov = iov + ret; | 741 | _iov = iov + ret; |
742 | size = reg->memory_size - addr + reg->guest_phys_addr; | 742 | size = reg->memory_size - addr + reg->guest_phys_addr; |
743 | _iov->iov_len = min((u64)len, size); | 743 | _iov->iov_len = min((u64)len, size); |
744 | _iov->iov_base = (void *)(unsigned long) | 744 | _iov->iov_base = (void __user *)(unsigned long) |
745 | (reg->userspace_addr + addr - reg->guest_phys_addr); | 745 | (reg->userspace_addr + addr - reg->guest_phys_addr); |
746 | s += size; | 746 | s += size; |
747 | addr += size; | 747 | addr += size; |
@@ -995,7 +995,7 @@ void vhost_discard_vq_desc(struct vhost_virtqueue *vq) | |||
995 | * want to notify the guest, using eventfd. */ | 995 | * want to notify the guest, using eventfd. */ |
996 | int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) | 996 | int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) |
997 | { | 997 | { |
998 | struct vring_used_elem *used; | 998 | struct vring_used_elem __user *used; |
999 | 999 | ||
1000 | /* The virtqueue contains a ring of used buffers. Get a pointer to the | 1000 | /* The virtqueue contains a ring of used buffers. Get a pointer to the |
1001 | * next entry in that used ring. */ | 1001 | * next entry in that used ring. */ |
@@ -1019,7 +1019,8 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) | |||
1019 | smp_wmb(); | 1019 | smp_wmb(); |
1020 | /* Log used ring entry write. */ | 1020 | /* Log used ring entry write. */ |
1021 | log_write(vq->log_base, | 1021 | log_write(vq->log_base, |
1022 | vq->log_addr + ((void *)used - (void *)vq->used), | 1022 | vq->log_addr + |
1023 | ((void __user *)used - (void __user *)vq->used), | ||
1023 | sizeof *used); | 1024 | sizeof *used); |
1024 | /* Log used index update. */ | 1025 | /* Log used index update. */ |
1025 | log_write(vq->log_base, | 1026 | log_write(vq->log_base, |