Skip to content

Commit

Permalink
vhost: use USER_DS in vhost_worker thread
Browse files Browse the repository at this point in the history
On some architectures address spaces are set up in a way that this is
not necessary to work properly but on some others (like s390) it is.
Make sure we operate on the user address space to allow copy_xxx_user()
from the vhost_worker() thread by setting it explicitly before calling
use_mm() and revert it after unuse_mm().

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jens Freimann authored and davem330 committed Jun 27, 2012
1 parent 57efd44 commit d7ffde3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ static int vhost_worker(void *data)
struct vhost_dev *dev = data;
struct vhost_work *work = NULL;
unsigned uninitialized_var(seq);
mm_segment_t oldfs = get_fs();

set_fs(USER_DS);
use_mm(dev->mm);

for (;;) {
Expand Down Expand Up @@ -229,6 +231,7 @@ static int vhost_worker(void *data)

}
unuse_mm(dev->mm);
set_fs(oldfs);
return 0;
}

Expand Down

0 comments on commit d7ffde3

Please sign in to comment.