Since when we are using the m2p_override it is not true anymore that the mmap''ed area doesn''t have corresponsing struct pages. Removing the VM_PFNMAP flag makes get_user_pages work on the mmap''ed user vma. An example test case would be using a Xen userspace block backend (QDISK) on a file on NFS using O_DIRECT. The patch should be backported back to 2.6.38. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- drivers/xen/gntdev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 99d8151..1ffd03b 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -722,7 +722,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND; if (use_ptemod) - vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP; + vma->vm_flags |= VM_DONTCOPY; vma->vm_private_data = map; -- 1.7.2.5
On Tue, Apr 03, 2012 at 12:25:02PM +0100, Stefano Stabellini wrote:> Since when we are using the m2p_override it is not true anymore that the^^^^ - get rid of that.> mmap''ed area doesn''t have corresponsing struct pages.That reads to me as !!do struct page. Which comes out as: "m2p_override_* API the mmap-ed are have corresponding struct pages'' ?> > Removing the VM_PFNMAP flag makes get_user_pages work on the mmap''ed user vma. > An example test case would be using a Xen userspace block backend > (QDISK) on a file on NFS using O_DIRECT. > > The patch should be backported back to 2.6.38.Add CC: stable@kernel.org then. But does this patch depend on other patches?> > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > --- > drivers/xen/gntdev.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c > index 99d8151..1ffd03b 100644 > --- a/drivers/xen/gntdev.c > +++ b/drivers/xen/gntdev.c > @@ -722,7 +722,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma) > vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND; > > if (use_ptemod) > - vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP; > + vma->vm_flags |= VM_DONTCOPY; > > vma->vm_private_data = map; > > -- > 1.7.2.5
On Tue, 3 Apr 2012, Konrad Rzeszutek Wilk wrote:> On Tue, Apr 03, 2012 at 12:25:02PM +0100, Stefano Stabellini wrote: > > Since when we are using the m2p_override it is not true anymore that the > ^^^^ - get rid of that. > > mmap''ed area doesn''t have corresponsing struct pages. > > That reads to me as !!do struct page. Which comes out as: > > "m2p_override_* API the mmap-ed are have corresponding struct pages'' ?Yes, indeed: m2p_override_* provides the corresponding struct pages> > Removing the VM_PFNMAP flag makes get_user_pages work on the mmap''ed user vma. > > An example test case would be using a Xen userspace block backend > > (QDISK) on a file on NFS using O_DIRECT. > > > > The patch should be backported back to 2.6.38. > > Add CC: stable@kernel.org then.I''ll resend CCing stable> But does this patch depend on other > patches?only on the m2p_override, that is in Linux since 2.6.38
Possibly Parallel Threads
- [PATCH] xen/gntdev,gntalloc: Remove unneeded VM flags
- [PATCH v2] xen/gntdev: do not set VM_PFNMAP
- [PATCH] xen: gntdev: move use of GNTMAP_contains_pte next to the map_op
- [PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert
- [PATCH v2 09/15] xen/gntdev: use mmu_range_notifier_insert