All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Anh Dinh <ug93tad@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	"<xen-devel@lists.xen.org>" <xen-devel@lists.xen.org>
Subject: Re: how to deal with copy_to_user returning non zero
Date: Mon, 10 Nov 2014 10:04:08 +0000	[thread overview]
Message-ID: <1415613848.27002.3.camel@citrix.com> (raw)
In-Reply-To: <CAAbkU4SUrk0nRT97T0eBqNB7-Z7MVLGoWJtP+DwPijbZEphM0w@mail.gmail.com>

On Sun, 2014-11-09 at 09:22 +0800, Anh Dinh wrote:
> Thanks,
> 
> 
> I've found out the reason it page-faulting is because I used malloc()
> to allocate the output buffer, which turns out to allocate lazily.
> Therefore the hypervisor page-fault because the memory is still
> waiting to be mapped by the kernel. 
> 
> 
> I simply touched all the allocated memory, and it works fine now. 

It might work, but unless it is using hypercall buffers and
XEN_GUEST_HANDLE then it is still subtly broken.

Ian.

      reply	other threads:[~2014-11-10 10:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 10:38 how to deal with copy_to_user returning non zero Anh Dinh
2014-11-07 10:44 ` Andrew Cooper
2014-11-07 10:57   ` And Dinh
2014-11-07 11:01     ` Andrew Cooper
2014-11-09  1:22       ` Anh Dinh
2014-11-10 10:04         ` Ian Campbell [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=1415613848.27002.3.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ug93tad@gmail.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.