From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: Marcelo Tosatti <marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
kvm-devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Matt Mackall <mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [patch 3/5] KVM: add kvm_follow_page()
Date: Sun, 23 Dec 2007 02:52:45 -0800 [thread overview]
Message-ID: <20071223025245.d839c86d.akpm@linux-foundation.org> (raw)
In-Reply-To: <476E39F2.4030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
On Sun, 23 Dec 2007 12:35:30 +0200 Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> Andrew Morton wrote:
> > On Sun, 23 Dec 2007 10:59:22 +0200 Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:
> >
> >
> >> Avi Kivity wrote:
> >>
> >>> Avi Kivity wrote:
> >>>
> >>>
> >>>> Exactly. But it is better to be explicit about it and pass the page
> >>>> directly like you did before. I hate to make you go back-and-fourth,
> >>>> but I did not understand the issue completely before.
> >>>>
> >>>>
> >>>>
> >>> btw, the call to gfn_to_page() can happen in page_fault() instead of
> >>> walk_addr(); that will reduce the amount of error handling, and will
> >>> simplify the callers to walk_addr() that don't need the page.
> >>>
> >>>
> >>>
> >> Note further that all this doesn't obviate the need for follow_page()
> >> (or get_user_pages_inatomic()); we still need something in update_pte()
> >> for the demand paging case.
> >>
> >
> > Please review -mm's mm/pagewalk.c for suitability.
> >
> > If is is unsuitable but repairable then please cc Matt Mackall
> > <mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.org> on the review.
> >
> >
>
> The "no locks are taken" comment is very worrying. We need accurate
> results.
take down_read(mm->mmap_sem) before calling it..
You have to do that anyway for its results to be meaningful in the caller.
Ditto get_user_pages().
> Getting pte_t's in the callbacks is a little too low level for kvm's use
> (which wants struct page pointers) but of course that easily handled in
> a kvm wrapper.
>
> I'd prefer an atomic version of get_user_pages(), but if pagewalk is
> fixed to take the necessary locks, it will do.
It isn't exported to modules at present, although I see no problem in
changing that.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2007-12-23 10:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-21 0:18 [patch 0/5] KVM shadow scalability enhancements Marcelo Tosatti
2007-12-21 0:18 ` [patch 1/5] KVM: concurrent guest walkers Marcelo Tosatti
2007-12-21 0:18 ` [patch 2/5] KVM: add kvm_read_guest_atomic() Marcelo Tosatti
2007-12-21 0:18 ` [patch 3/5] KVM: add kvm_follow_page() Marcelo Tosatti
[not found] ` <20071221002024.345682789-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-12-22 19:42 ` Avi Kivity
[not found] ` <476D68A3.3000200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 5:25 ` Marcelo Tosatti
2007-12-23 7:03 ` Avi Kivity
[not found] ` <476E083B.5040600-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 8:41 ` Avi Kivity
[not found] ` <476E1F23.3020609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 8:59 ` Avi Kivity
[not found] ` <476E236A.9000800-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 9:26 ` Andrew Morton
[not found] ` <20071223012618.e8cf8320.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2007-12-23 10:35 ` Avi Kivity
[not found] ` <476E39F2.4030202-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 10:52 ` Andrew Morton [this message]
[not found] ` <20071223025245.d839c86d.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2007-12-23 11:01 ` Avi Kivity
[not found] ` <476E4005.90003-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-23 20:15 ` Marcelo Tosatti
2007-12-23 20:41 ` Andrew Morton
2007-12-24 6:56 ` Avi Kivity
[not found] ` <476F5801.2030002-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-24 14:26 ` Marcelo Tosatti
2007-12-24 14:36 ` Avi Kivity
2007-12-23 19:14 ` Marcelo Tosatti
2007-12-24 6:50 ` Avi Kivity
[not found] ` <476F56A5.2020607-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-24 14:28 ` Marcelo Tosatti
2007-12-24 14:34 ` Avi Kivity
2007-12-21 0:18 ` [patch 4/5] KVM: export follow_page() Marcelo Tosatti
[not found] ` <20071221002024.423895760-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-12-22 19:43 ` Avi Kivity
2007-12-21 0:18 ` [patch 5/5] KVM: switch to mmu spinlock Marcelo Tosatti
[not found] ` <20071221001821.029994250-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-12-22 19:46 ` [patch 0/5] KVM shadow scalability enhancements 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=20071223025245.d839c86d.akpm@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=marcelo-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mpm-VDJrAJ4Gl5ZBDgjK7y7TUQ@public.gmane.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