From: "Michael S. Tsirkin" <mst@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: kvm@vger.kernel.org, netdev@vger.kernel.org,
Jens Freimann <jfrei@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/1] use USER_DS in vhost_worker thread
Date: Tue, 26 Jun 2012 14:42:26 +0300 [thread overview]
Message-ID: <20120626114226.GC13618@redhat.com> (raw)
In-Reply-To: <1340708398-17965-2-git-send-email-borntraeger@de.ibm.com>
On Tue, Jun 26, 2012 at 12:59:58PM +0200, Christian Borntraeger wrote:
> From: Jens Freimann <jfrei@linux.vnet.ibm.com>
>
> 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>
Dave, can you queue this up for 3.5 please?
Thanks.
> ---
> 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 94dbd25..112156f 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -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 (;;) {
> @@ -229,6 +231,7 @@ static int vhost_worker(void *data)
>
> }
> unuse_mm(dev->mm);
> + set_fs(oldfs);
> return 0;
> }
>
> --
> 1.7.0.4
prev parent reply other threads:[~2012-06-26 11:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 10:59 [PATCH 0/1] vhost, use_mm and KERNEL_DS Christian Borntraeger
2012-06-26 10:59 ` [PATCH 1/1] use USER_DS in vhost_worker thread Christian Borntraeger
2012-06-26 11:42 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120626114226.GC13618@redhat.com \
--to=mst@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).