From: Eamon Walsh Subject: Re: Frame buffer mmap not working in pvops dom0 Date: Wed, 21 Jul 2010 16:36:36 -0400 Message-ID: <4C475A54.2040908@tycho.nsa.gov> References: <4C46FA8D.6040809@tycho.nsa.gov> <20100721141613.GG17817@reaktio.net> <20100721144209.GA5031@phenom.dumpdata.com> <4C4711BB.5090905@tycho.nsa.gov> <20100721190056.GA9756@phenom.dumpdata.com> <4C474909.8080005@tycho.nsa.gov> <20100721195006.GA5839@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20100721195006.GA5839@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Konrad Rzeszutek Wilk Cc: Daniel De Graaf , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 07/21/2010 03:50 PM, Konrad Rzeszutek Wilk wrote: >> 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? > Either patch fixes the problem for me. Tested-by: Eamon Walsh -- Eamon Walsh National Security Agency