[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v1 2/8]: PVH mmu changes



On Tue, 2 Oct 2012 12:23:58 +0100
Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> wrote:

> On Mon, 1 Oct 2012, Mukesh Rathor wrote:
> > On Mon, 1 Oct 2012 14:32:44 -0700
> > Mukesh Rathor <mukesh.rathor@xxxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.