lkml.org 
[lkml]   [2005]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    SubjectRe: More info for DSM w/r/t sunffb on 2.6.15-rc6
    From
    From: Linus Torvalds <torvalds@osdl.org>
    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 <davem@davemloft.net>

    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 majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-12-24 00:51    [W:0.021 / U:149.756 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site