From: Chris Wright Subject: Re: xsd_kva mmap Date: Mon, 6 Mar 2006 11:35:47 -0800 Message-ID: <20060306193547.GW3883@sorel.sous-sol.org> References: <20060306183023.GA7814@sorel.sous-sol.org> <2510641adc7c67a4d0d20a0224b0ece5@cl.cam.ac.uk> <20060306191150.GV3883@sorel.sous-sol.org> <989e5b7733ebbfed8423ab1f981b1b58@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <989e5b7733ebbfed8423ab1f981b1b58@cl.cam.ac.uk> 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: Chris Wright , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org * Keir Fraser (Keir.Fraser@cl.cam.ac.uk) wrote: > > On 6 Mar 2006, at 19:11, Chris Wright wrote: > > >>Also, your patch would need to set vma->vm_pgoff before calling > >>remap_pfn_range(), or the unmap code will incorrectly mess with page > >>reference counts (because the skanky VM_PFNMAP check in vm_normal_page > >>would not trigger and so that function will return non-NULL). > > > >Thanks for the eyes, esp. considering that's what the original fix was > >all about ;-) > > Actually, now I look again, it appears that remap_pfn_range() deals > with the re-setting of vm_pgoff itself (conditional on > is_cow_mapping(), and prefixed with an enormous comment). So re-setting > in the caller is unnecessary and your patch is just fine. Well, I did test it for the page count problem, and it passed. But started to question my read of the code based on your original comments above. > I think there are one or two other places in Xen code that I munge > vm_pgoff, so I guess I can clean up a little now. :-) > > Sorry about that... No problem, thanks for the clarification. -chris