From: Herbert Xu Subject: Re: RFC: [0/2] Remove netloop by lazy copying in netback Date: Tue, 27 Mar 2007 10:35:31 +1000 Message-ID: <20070327003531.GA19670@gondor.apana.org.au> References: <20070326210828.GA17879@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Development Mailing List List-Id: xen-devel@lists.xenproject.org On Tue, Mar 27, 2007 at 01:33:58AM +0100, Keir Fraser wrote: > > >> Can't we wrap the 'swap around' critical section in an irq-safe spinlock? > >> All we'd need to do from the page-fault handler then is a barrier on that > >> spinlock (i.e, wait for it to be released). Netback can simply copy the page > >> to new memory frame, unmap the grant, then relocate the new memory frame's > >> pseudophysical address. > > > > That works fine for the x86 case. But when it's auto-translated, > > you won't even get a page fault in the guest because the guest PTE > > is unchanged and completely valid. > > How about you invalidate the PTE for the duration of the critical section. > It's a bit skanky, but would work around this issue quite nicely! Maybe I am missing something. Because I thought we've agreed that we can't (or don't want to) do the PTE trick because of the large pages (16MB at least) used for the identity mapping. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt