From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Xu, Jiajun" <jiajun.xu@intel.com>,
kvm@vger.kernel.org, Avi Kivity <avi@qumranet.com>
Subject: Re: [PATCH] add compat wrapper for get_user_pages_fast
Date: Thu, 18 Sep 2008 19:30:55 -0300 [thread overview]
Message-ID: <20080918223055.GA24183@dmt.cnet> (raw)
In-Reply-To: <48D282C0.3050100@siemens.com>
On Thu, Sep 18, 2008 at 06:33:04PM +0200, Jan Kiszka wrote:
> Not sure if this is correct, but here is at least a compile fix.
Looks good.
> Note that the original mmem_map locking scope was partly far broader on
> older kernels than with Marcelo's patch and this fix now. Could anyone
> comment on the correctness?
I think all cases have been covered (vma manipulation, find_vma
callers).
>
> ---------
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> kernel/external-module-compat-comm.h | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> Index: b/kernel/external-module-compat-comm.h
> ===================================================================
> --- a/kernel/external-module-compat-comm.h
> +++ b/kernel/external-module-compat-comm.h
> @@ -531,3 +531,20 @@ struct pci_dev;
> struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
>
> #endif
> +
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
> +
> +static inline int get_user_pages_fast(unsigned long start, int nr_pages,
> + int write, struct page **pages)
> +{
> + int npages;
> +
> + down_read(¤t->mm->mmap_sem);
> + npages = get_user_pages(current, current->mm, start, nr_pages, write,
> + 0, pages, NULL);
> + up_read(¤t->mm->mmap_sem);
> +
> + return npages;
> +}
> +
> +#endif
next prev parent reply other threads:[~2008-09-18 22:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 3:17 KVM Build error with 2.6.26 Xu, Jiajun
2008-09-18 8:25 ` Jan Kiszka
2008-09-18 16:33 ` [PATCH] add compat wrapper for get_user_pages_fast Jan Kiszka
2008-09-18 22:30 ` Marcelo Tosatti [this message]
2008-09-19 23:52 ` Avi Kivity
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=20080918223055.GA24183@dmt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@qumranet.com \
--cc=jan.kiszka@siemens.com \
--cc=jiajun.xu@intel.com \
--cc=kvm@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 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.