diff options
author | Jens Freimann <jfrei@linux.vnet.ibm.com> | 2012-06-25 20:59:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 00:10:56 -0400 |
commit | d7ffde35e31a81100d2d0d2c4013cbf527bb32ea (patch) | |
tree | 0939e0cabb626b4258e53a08f7a7713d534dfab5 /drivers/vhost/vhost.c | |
parent | 57efd44c8cad440fb00ef8078cb018ab2f221373 (diff) |
vhost: use USER_DS in vhost_worker thread
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>
Diffstat (limited to 'drivers/vhost/vhost.c')
-rw-r--r-- | drivers/vhost/vhost.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 94dbd25caa30..112156f68afb 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -191,7 +191,9 @@ static int vhost_worker(void *data) | |||
191 | struct vhost_dev *dev = data; | 191 | struct vhost_dev *dev = data; |
192 | struct vhost_work *work = NULL; | 192 | struct vhost_work *work = NULL; |
193 | unsigned uninitialized_var(seq); | 193 | unsigned uninitialized_var(seq); |
194 | mm_segment_t oldfs = get_fs(); | ||
194 | 195 | ||
196 | set_fs(USER_DS); | ||
195 | use_mm(dev->mm); | 197 | use_mm(dev->mm); |
196 | 198 | ||
197 | for (;;) { | 199 | for (;;) { |
@@ -229,6 +231,7 @@ static int vhost_worker(void *data) | |||
229 | 231 | ||
230 | } | 232 | } |
231 | unuse_mm(dev->mm); | 233 | unuse_mm(dev->mm); |
234 | set_fs(oldfs); | ||
232 | return 0; | 235 | return 0; |
233 | } | 236 | } |
234 | 237 | ||