All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Frame buffer mmap not working in pvops dom0
Date: Wed, 21 Jul 2010 15:50:06 -0400	[thread overview]
Message-ID: <20100721195006.GA5839@phenom.dumpdata.com> (raw)
In-Reply-To: <4C474909.8080005@tycho.nsa.gov>

> 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?

  reply	other threads:[~2010-07-21 19:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21 13:47 Frame buffer mmap not working in pvops dom0 Daniel De Graaf
2010-07-21 14:16 ` Pasi Kärkkäinen
2010-07-21 14:42   ` Konrad Rzeszutek Wilk
2010-07-21 14:49     ` Pasi Kärkkäinen
2010-07-21 15:26     ` Daniel De Graaf
2010-07-21 19:00       ` Konrad Rzeszutek Wilk
2010-07-21 19:12         ` Konrad Rzeszutek Wilk
2010-07-21 19:22         ` Daniel De Graaf
2010-07-21 19:50           ` Konrad Rzeszutek Wilk [this message]
2010-07-21 20:27             ` Daniel De Graaf
2010-07-28 14:29               ` Konrad Rzeszutek Wilk
2010-07-28 15:33                 ` Konrad Rzeszutek Wilk
2010-07-28 18:09                 ` Daniel De Graaf
2010-07-21 20:36             ` Eamon Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100721195006.GA5839@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.