* fbmem: VM_IO set, but not propagated.
@ 2010-07-22 21:31 Konrad Rzeszutek Wilk
2010-07-26 22:38 ` Andrew Morton
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-07-22 21:31 UTC (permalink / raw)
To: linux-fbdev
Hey,
This bug was found when Linux kernel was running under Xen.
In that scenario, any page that has VM_IO flag to it, means that it
MUST be a MMIO/VRAM backend memory , _not_ System RAM. That is what the
fbmem.c does: sets VM_IO, ioremaps the region - everything is peachy.
Well, not exactly. The vm_page_prot does not get the relevant
PTE flags set (_PAGE_IOMAP) which under Xen is a death-kneel to pages
that are referencing real physical devices but don't have that flag set.
Here is the patch:
Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Date: Wed Jul 21 16:52:46 2010 -0400
fb: propagate VM_IO to VMA.
When we setup up the VMA flags for the mmap flag and we end up using
the fallback mmap functionality we set the vma->vm_flags |= VM_IO.
However we neglect to propagate the flag to the vma->vm_page_prot.
This patch fixes this.
Tested-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 99bbd28..057433a 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))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: fbmem: VM_IO set, but not propagated.
2010-07-22 21:31 fbmem: VM_IO set, but not propagated Konrad Rzeszutek Wilk
@ 2010-07-26 22:38 ` Andrew Morton
2010-07-27 14:42 ` Daniel De Graaf
2010-07-27 14:53 ` Konrad Rzeszutek Wilk
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2010-07-26 22:38 UTC (permalink / raw)
To: linux-fbdev
On Thu, 22 Jul 2010 17:31:28 -0400
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> This bug was found when Linux kernel was running under Xen.
> In that scenario, any page that has VM_IO flag to it, means that it
> MUST be a MMIO/VRAM backend memory , _not_ System RAM. That is what the
> fbmem.c does: sets VM_IO, ioremaps the region - everything is peachy.
>
> Well, not exactly. The vm_page_prot does not get the relevant
> PTE flags set (_PAGE_IOMAP) which under Xen is a death-kneel to pages
> that are referencing real physical devices but don't have that flag set.
>
> Here is the patch:
>
> Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Date: Wed Jul 21 16:52:46 2010 -0400
>
> fb: propagate VM_IO to VMA.
>
> When we setup up the VMA flags for the mmap flag and we end up using
> the fallback mmap functionality we set the vma->vm_flags |= VM_IO.
> However we neglect to propagate the flag to the vma->vm_page_prot.
>
> This patch fixes this.
>
> Tested-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>
Confused. We have From:Konrad and Author:Daniel and no signoff from Daniel.
I've committed the patch assuming that Daniel was the author, but
didn't sign off the patch. Your signoff is sufficient for merging
purposes.
But maybe I was wrong.
I'm also assuming that we can merge this into 2.6.36 and not backport
it into -stable. But maybe I'm wrong about that too! Talk to me.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: fbmem: VM_IO set, but not propagated.
2010-07-22 21:31 fbmem: VM_IO set, but not propagated Konrad Rzeszutek Wilk
2010-07-26 22:38 ` Andrew Morton
@ 2010-07-27 14:42 ` Daniel De Graaf
2010-07-27 14:53 ` Konrad Rzeszutek Wilk
2 siblings, 0 replies; 4+ messages in thread
From: Daniel De Graaf @ 2010-07-27 14:42 UTC (permalink / raw)
To: linux-fbdev
On 07/26/2010 06:38 PM, Andrew Morton wrote:
> On Thu, 22 Jul 2010 17:31:28 -0400
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
>
>> This bug was found when Linux kernel was running under Xen.
>> In that scenario, any page that has VM_IO flag to it, means that it
>> MUST be a MMIO/VRAM backend memory , _not_ System RAM. That is what the
>> fbmem.c does: sets VM_IO, ioremaps the region - everything is peachy.
>>
>> Well, not exactly. The vm_page_prot does not get the relevant
>> PTE flags set (_PAGE_IOMAP) which under Xen is a death-kneel to pages
>> that are referencing real physical devices but don't have that flag set.
>>
>> Here is the patch:
>>
>> Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
>> Date: Wed Jul 21 16:52:46 2010 -0400
>>
>> fb: propagate VM_IO to VMA.
>>
>> When we setup up the VMA flags for the mmap flag and we end up using
>> the fallback mmap functionality we set the vma->vm_flags |= VM_IO.
>> However we neglect to propagate the flag to the vma->vm_page_prot.
>>
>> This patch fixes this.
>>
>> Tested-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>>
>
> Confused. We have From:Konrad and Author:Daniel and no signoff from Daniel.
>
> I've committed the patch assuming that Daniel was the author, but
> didn't sign off the patch. Your signoff is sufficient for merging
> purposes.
>
> But maybe I was wrong.
>
>
> I'm also assuming that we can merge this into 2.6.36 and not backport
> it into -stable. But maybe I'm wrong about that too! Talk to me.
>
If it's useful to have a signoff line from me, you can add it; I guess
it wasn't clear in my previous reply that I was signing off on it.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: fbmem: VM_IO set, but not propagated.
2010-07-22 21:31 fbmem: VM_IO set, but not propagated Konrad Rzeszutek Wilk
2010-07-26 22:38 ` Andrew Morton
2010-07-27 14:42 ` Daniel De Graaf
@ 2010-07-27 14:53 ` Konrad Rzeszutek Wilk
2 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-07-27 14:53 UTC (permalink / raw)
To: linux-fbdev
On Mon, Jul 26, 2010 at 03:38:12PM -0700, Andrew Morton wrote:
> On Thu, 22 Jul 2010 17:31:28 -0400
> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
>
> > This bug was found when Linux kernel was running under Xen.
> > In that scenario, any page that has VM_IO flag to it, means that it
> > MUST be a MMIO/VRAM backend memory , _not_ System RAM. That is what the
> > fbmem.c does: sets VM_IO, ioremaps the region - everything is peachy.
> >
> > Well, not exactly. The vm_page_prot does not get the relevant
> > PTE flags set (_PAGE_IOMAP) which under Xen is a death-kneel to pages
> > that are referencing real physical devices but don't have that flag set.
> >
> > Here is the patch:
> >
> > Author: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> > Date: Wed Jul 21 16:52:46 2010 -0400
> >
> > fb: propagate VM_IO to VMA.
> >
> > When we setup up the VMA flags for the mmap flag and we end up using
> > the fallback mmap functionality we set the vma->vm_flags |= VM_IO.
> > However we neglect to propagate the flag to the vma->vm_page_prot.
> >
> > This patch fixes this.
> >
> > Tested-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> >
>
> Confused. We have From:Konrad and Author:Daniel and no signoff from Daniel.
So Daniel came up with the original fix, I've came to him and suggested
that perhaps we should use the vm_get_page_prot, and he agreed.
Since I've kept the patch in my branch of "Xen-KMS/DRM/TTM-fixes" I
figured I should post the patch upstream and hence I signed off on it.
>
> I've committed the patch assuming that Daniel was the author, but
> didn't sign off the patch. Your signoff is sufficient for merging
Yes. He is the author. Let me refer back to my notes but I figured
if the patch has an Author: set there was no need for an extra S-o-b?
> purposes.
>
> But maybe I was wrong.
>
>
> I'm also assuming that we can merge this into 2.6.36 and not backport
> it into -stable. But maybe I'm wrong about that too! Talk to me.
No need to backport it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-07-27 14:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 21:31 fbmem: VM_IO set, but not propagated Konrad Rzeszutek Wilk
2010-07-26 22:38 ` Andrew Morton
2010-07-27 14:42 ` Daniel De Graaf
2010-07-27 14:53 ` Konrad Rzeszutek Wilk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).