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

Re: [Xen-devel] Frame buffer mmap not working in pvops dom0



> The code path is fb_mmap with a NULL fbops->fb_mmap, so it just
> delegates to the default code. Specifically, io_remap_pfn_range is where
> the bad mapping is requested.
> 
> I have a patch that fixes the issue, but I'm not sure under what
> conditions the _PAGE_IOMAP bit needs to be set.

Oh wow. That easy, eh?

> --- a/arch/x86/include/asm/fb.h
> +++ b/arch/x86/include/asm/fb.h
> @@ -10,6 +10,7 @@ static inline void fb_pgprotect
>  {
>         if (boot_cpu_data.x86 > 3)
>                 pgprot_val(vma->vm_page_prot) |= _PAGE_PCD;
> +       pgprot_val(vma->vm_page_prot) |= _PAGE_IOMAP;
>  }
> 
>  #ifdef CONFIG_X86_32


I would say this patch is more sensible as the VM_IO flag had been
set already, it just never got propagated:


diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 731fce6..187171b 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1362,6 +1362,7 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
        vma->vm_pgoff = off >> PAGE_SHIFT;
        /* This is an IO map - tell maydump to skip this VMA */
        vma->vm_flags |= VM_IO | VM_RESERVED;
+       vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
        fb_pgprotect(file, vma, off);
        if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
                             vma->vm_end - vma->vm_start, vma->vm_page_prot))


If that fixes your problem, are you OK with me sticking a Signed-off-by:
from you on this patch?

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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