From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH v1 2/8]: PVH mmu changes Date: Tue, 2 Oct 2012 15:22:31 -0700 Message-ID: <20121002152231.0c5d7b26@mantra.us.oracle.com> References: <20120921121556.1a0ea8af@mantra.us.oracle.com> <20121001143244.36b4c270@mantra.us.oracle.com> <20121001144455.3ba7e10b@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "Xen-devel@lists.xensource.com" , Ian Campbell , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Tue, 2 Oct 2012 12:23:58 +0100 Stefano Stabellini wrote: > On Mon, 1 Oct 2012, Mukesh Rathor wrote: > > On Mon, 1 Oct 2012 14:32:44 -0700 > > Mukesh Rathor wrote: > > > > > > > > So, the mapcount must be not be getting set in "normal" case > > > properly it appears. Marking it special causes it so skip few > > > things. Debugging... > > > > Shall I just leave it special for now, and come back and revisit > > this later? > > special is going to create troubles if somebody starts using these > pages in unexpected ways (for example dma from hardware ot gupf). > > Also I fail to see how this case is any different from mapping pages > using gntdev (see gntdev_mmap) that works fine without special. > > Maybe we are not setting some vm_flags that we are supposed to set > (VM_RESERVED | VM_IO | VM_DONTCOPY)? > I see that we are setting them in privcmd_mmap but not in > privcmd_ioctl_mmap_batch... No, that is getting set. privcmd_mmap is hook for mmap(), so it gets called for both. If its not marked special, vm_normal_page() will not check for the VM_PFNMAP flag, which is what we want. It works for PV dom0 because remap_area_mfn_pte_fn() has also marked it special: static int remap_area_mfn_pte_fn(pte_t *ptep, pgtable_t token, unsigned long addr, void *data) { struct remap_data *rmd = data; pte_t pte = pte_mkspecial(pfn_pte(rmd->mfn++, rmd->prot)); thanks, Mukesh