Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
authorDavid S. Miller <davem@davemloft.net>
Thu, 15 Apr 2010 05:52:46 +0000 (22:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Apr 2010 05:52:46 +0000 (22:52 -0700)
1  2 
drivers/vhost/net.c
drivers/vhost/vhost.c

diff --combined drivers/vhost/net.c
index 9777583218ff9fa4abaa7be5896de223b92f77ab,38989d1335bc139c84bffbfe3e1934fe747b1367..aa88911c95045d10e1089ae477b1f43eab7de614
@@@ -17,7 -17,6 +17,7 @@@
  #include <linux/workqueue.h>
  #include <linux/rcupdate.h>
  #include <linux/file.h>
 +#include <linux/slab.h>
  
  #include <linux/net.h>
  #include <linux/if_packet.h>
@@@ -642,7 -641,7 +642,7 @@@ static struct miscdevice vhost_net_mis
        &vhost_net_fops,
  };
  
- int vhost_net_init(void)
static int vhost_net_init(void)
  {
        int r = vhost_init();
        if (r)
@@@ -659,7 -658,7 +659,7 @@@ err_init
  }
  module_init(vhost_net_init);
  
- void vhost_net_exit(void)
static void vhost_net_exit(void)
  {
        misc_deregister(&vhost_net_misc);
        vhost_cleanup();
diff --combined drivers/vhost/vhost.c
index e69d238c5af05254e16cad73b1456549cb8dbc35,3f101946b4f9c20dff67c6e0d5875db6b59d8573..5c9c657ab753271c6ea9006331c5aee06df0e588
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/poll.h>
  #include <linux/file.h>
  #include <linux/highmem.h>
 +#include <linux/slab.h>
  
  #include <linux/net.h>
  #include <linux/if_packet.h>
@@@ -715,8 -714,8 +715,8 @@@ int vhost_log_write(struct vhost_virtqu
        return 0;
  }
  
- int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
-                  struct iovec iov[], int iov_size)
static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
+                         struct iovec iov[], int iov_size)
  {
        const struct vhost_memory_region *reg;
        struct vhost_memory *mem;
                _iov = iov + ret;
                size = reg->memory_size - addr + reg->guest_phys_addr;
                _iov->iov_len = min((u64)len, size);
-               _iov->iov_base = (void *)(unsigned long)
+               _iov->iov_base = (void __user *)(unsigned long)
                        (reg->userspace_addr + addr - reg->guest_phys_addr);
                s += size;
                addr += size;
@@@ -995,7 -994,7 +995,7 @@@ void vhost_discard_vq_desc(struct vhost
   * want to notify the guest, using eventfd. */
  int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len)
  {
-       struct vring_used_elem *used;
+       struct vring_used_elem __user *used;
  
        /* The virtqueue contains a ring of used buffers.  Get a pointer to the
         * next entry in that used ring. */
                smp_wmb();
                /* Log used ring entry write. */
                log_write(vq->log_base,
-                         vq->log_addr + ((void *)used - (void *)vq->used),
+                         vq->log_addr +
+                          ((void __user *)used - (void __user *)vq->used),
                          sizeof *used);
                /* Log used index update. */
                log_write(vq->log_base,