aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-04-15 01:52:46 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-15 01:52:46 -0400
commitfea069152614cdeefba4b2bf80afcddb9c217fc8 (patch)
tree97a4ca0c1afabe94b69110409a46347a093cff45
parent5f6c01819979afbfec7e0b15fe52371b8eed87e8 (diff)
parenta8d3782f9ea7574b8648e69bbb05a0b1d93e437e (diff)
Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
-rw-r--r--drivers/vhost/net.c4
-rw-r--r--drivers/vhost/vhost.c11
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 9777583218ff..aa88911c9504 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -642,7 +642,7 @@ static struct miscdevice vhost_net_misc = {
642 &vhost_net_fops, 642 &vhost_net_fops,
643}; 643};
644 644
645int vhost_net_init(void) 645static int vhost_net_init(void)
646{ 646{
647 int r = vhost_init(); 647 int r = vhost_init();
648 if (r) 648 if (r)
@@ -659,7 +659,7 @@ err_init:
659} 659}
660module_init(vhost_net_init); 660module_init(vhost_net_init);
661 661
662void vhost_net_exit(void) 662static void vhost_net_exit(void)
663{ 663{
664 misc_deregister(&vhost_net_misc); 664 misc_deregister(&vhost_net_misc);
665 vhost_cleanup(); 665 vhost_cleanup();
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
718int translate_desc(struct vhost_dev *dev, u64 addr, u32 len, 718static 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. */
996int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) 996int 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,