From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/1] direct mmio for passthrough - kernel part Date: Thu, 03 Apr 2008 11:51:36 +0300 Message-ID: <47F49A98.2050704@qumranet.com> 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> <47F36B19.8020006@qumranet.com> <20080402115019.GO19189@duo.random> 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, Ben-Ami Yassour1 To: Andrea Arcangeli Return-path: In-Reply-To: <20080402115019.GO19189@duo.random> 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 Andrea Arcangeli wrote: > On Wed, Apr 02, 2008 at 02:16:41PM +0300, Avi Kivity wrote: > >> Ugh, there's still mark_page_accessed() and SetPageDirty(). >> > > btw, like PG_dirty is only set if the spte is writeable, > mark_page_accessed should only run if the accessed bit is set in the > spte. It doesn't matter now as nobody could possibly clear it, No one will clear it now, but it can start out cleared. This is done on speculative mmu_set_spte(): when the guest writes into its page tables, we update the spte speculatively, but the guest may not actually access that location (for example, due to a page fault clustering). So the change makes sense even now. > It still skips an atomic op. Your plan still sounds just fine despite > the above, infact it sounds too perfect: the awk hack to re-add the > refcounting when building the external module if CONFIG_MMU_NOTIFIER > isn't defined is going to be messy, a plain CONFIG_MMU_NOTIFIER in > kvm.git would be simpler and more robust IMHO even if less perfect :). > Worst case, we stick a get_user_pages() inside the memslot setup function. That makes things not swappable for pre-mmu notifiers, but completely safe. I'd rather avoid special casing the core code, whenever possible. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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