WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] Frame buffer mmap not working in pvops dom0
From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Date: Wed, 21 Jul 2010 16:27:59 -0400
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 21 Jul 2010 13:36:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100721195006.GA5839@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: National Security Agency
References: <4C46FA8D.6040809@xxxxxxxxxxxxx> <20100721141613.GG17817@xxxxxxxxxxx> <20100721144209.GA5031@xxxxxxxxxxxxxxxxxxx> <4C4711BB.5090905@xxxxxxxxxxxxx> <20100721190056.GA9756@xxxxxxxxxxxxxxxxxxx> <4C474909.8080005@xxxxxxxxxxxxx> <20100721195006.GA5839@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Thunderbird/3.0.5
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?
> 

Yep, your version also fixes the problem, and I agree it's more
sensible. I'm OK with signing off on that patch.

-- 

Daniel De Graaf
National Security Agency

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