From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH 1/1] direct mmio for passthrough - kernel part Date: Wed, 02 Apr 2008 09:59:56 -0500 Message-ID: <47F39F6C.9010801@codemonkey.ws> References: <47F29057.7050004@qumranet.com> <47F2955B.6060200@codemonkey.ws> <47F30C63.4080402@qumranet.com> <20080402070306.GG19189@duo.random> <47F356FA.6010409@qumranet.com> <20080402102820.GI19189@duo.random> <47F36722.2000405@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, allen.m.kay@intel.com, Andrea Arcangeli , Ben-Ami Yassour1 To: Avi Kivity Return-path: In-Reply-To: <47F36722.2000405@qumranet.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Avi Kivity wrote: > Andrea Arcangeli wrote: >> On Wed, Apr 02, 2008 at 12:50:50PM +0300, Avi Kivity wrote: >> >>> Isn't it faster though? We don't need to pull in the cacheline >>> containing the struct page anymore. >>> >> >> Exactly, not only that, get_user_pages is likely a bit slower that we >> need for just kvm pte lookup. GRU uses follow_page directly because it >> runs in the tlb miss handler, for us instead the tlb miss handler >> doesn't invoke a page fault unless the spte is non present. >> >> > > How about this plan? > > 0. Merge mmu notifiers Are mmu-notifiers likely to get pushed when the 2.6.26 window opens up? > 1. gfn_to_page() -> gfn_to_pfn() > > Still keeping the refcount. Change bad_page to kvm_bad_hfn. kvm_bad_pfn. > 2. Drop the refcounting from gfn_to_pfn() and from kvm_release_page_*() > > Still using get_user_pages() (and dropping the refcount immediately) > > Simultaneously, change hack_module.awk to add the refcount back. This has the dependency on mmu notifiers so step 1 can conceivably be merged in the absence of mmu notifiers. Regards, Anthony Liguori > 3. Export follow_page() or something based on fast_gup(), and use it > > btw, if we change the method we use to read the Linux pte, I'd like to > get the writable bit out of it. This was, when we create an spte for > a gpte that is writable and dirty, we can set the spte writable iff > the Linux pte is writable. This avoids breaking COW unnecessarily. > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace