mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: torvalds@osdl.org
Cc: michael.bishop@APPIQ.com, linux-kernel@vger.kernel.org,
	hugh@veritas.com, nickpiggin@yahoo.com.au
Subject: Re: More info for DSM w/r/t sunffb on 2.6.15-rc6
Date: Fri, 23 Dec 2005 15:45:09 -0800 (PST)	[thread overview]
Message-ID: <20051223.154509.86780332.davem@davemloft.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0512231223040.14098@g5.osdl.org>

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;

  reply	other threads:[~2005-12-23 23:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 16:23 Michael Bishop
2005-12-23 19:19 ` David S. Miller
2005-12-23 20:53   ` Linus Torvalds
2005-12-23 23:45     ` David S. Miller [this message]
2005-12-24  1:21       ` Hugh Dickins
2005-12-24  7:46         ` David S. Miller
2005-12-24  9:07           ` Hugh Dickins
2006-03-21 10:28             ` David S. Miller
2005-12-24  8:32       ` Linus Torvalds
2005-12-24  9:16         ` Hugh Dickins
2005-12-24 20:08         ` David S. Miller
     [not found] <DF925A10E7204748977502BECE3D1123015C4DCE@exch02.appiq.com>
2005-12-24  8:29 ` Linus Torvalds

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=20051223.154509.86780332.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.bishop@APPIQ.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®