Re: More info for DSM w/r/t sunffb on 2.6.15-rc6

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

 



From: Linus Torvalds <[email protected]>
Date: Fri, 23 Dec 2005 12:53:16 -0800 (PST)

> So it may be that the insane sparc remap_pfn_range() users need to set the 
> dirty/accessed bits in the page protection flags by hand before to avoid 
> that. David?

I'm pretty sure we set the dirty accessed bits at mapping time, so
that shouldn't be an issue.

But I wonder whether any of this is necessary at all.

I did some digging to see how far back the "fall back to MAP_SHARED
if MAP_PRIVATE fails" logic is in the X11R6 tree.

I went back as far as I could in the XORG and XFree86 CVS for
that SBUS support code, and the fallback to MAP_SHARED code has
always been there.

So I think something as simple as returning -EINVAL in the SBUS
framebuffer mmap() driver if VM_SHARED is not set would be sufficient
to deal with this.

Something like this patch below.

Signed-off-by: David S. Miller <[email protected]>

diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c
index 646c43f..ac937da 100644
--- a/drivers/video/sbuslib.c
+++ b/drivers/video/sbuslib.c
@@ -46,6 +46,9 @@ int sbusfb_mmap_helper(struct sbus_mmap_
 	unsigned long off;
 	int i;
                                         
+	if (!(vma->vm_flags & VM_SHARED))
+		return -EINVAL;
+
 	size = vma->vm_end - vma->vm_start;
 	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
 		return -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux