mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: akpm@osdl.org
Cc: maxextreme@gmail.com, vagabon.xyz@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH update6] drivers: add LCD support
Date: Thu, 02 Nov 2006 16:00:35 -0800 (PST)	[thread overview]
Message-ID: <20061102.160035.85409500.davem@davemloft.net> (raw)
In-Reply-To: <20061102120412.bc25e2d0.akpm@osdl.org>

From: Andrew Morton <akpm@osdl.org>
Date: Thu, 2 Nov 2006 12:04:12 -0800

> On Thu, 2 Nov 2006 19:33:48 +0000
> "Miguel Ojeda" <maxextreme@gmail.com> wrote:
> 
> > May 2.6.18-new vmalloc
> > related functions help correlating userspace & kernel addresses? I
> > will try them and come with an answer tomorrow.
> > 
> > Quoting http://lwn.net/Articles/2.6-kernel-api/
> > 
> > "Some functions have been added to make it easy for kernel code to
> > allocate a buffer with vmalloc() and map it into user space. They are:
> > 
> >      void *vmalloc_user(unsigned long size);
> >      void *vmalloc_32_user(unsigned long size);
> >      int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
> >                              unsigned long pgoff);
> > 
> > The first two functions are a form of vmalloc() which obtain memory
> > intended to be mapped into user space; among other things, they zero
> > the entire range to avoid leaking data. vmalloc_32_user() allocates
> > low memory only. A call to remap_vmalloc_range() will complete the
> > job; it will refuse, however, to remap memory which has not been
> > allocated with one of the two functions above."
> 
> No, it doesn't look like those helper functions are designed to handle this.
> 
> I'm really not the person to be asking about this.  I can poke around in
> arch/sparc64/kernel/sys_sparc.c:arch_get_unmapped_area() as well as the
> next guy, and it seems to be doing the right thing for MAP_FIXED, but
> how/whether it handles !MAP_FIXED I do not know.  Ask davem ;)

Unfortunately that code never gets called for MAP_FIXED :-)

I'll comment on these issues and explain what needs to occur,
we have several things that want to do this kind of user/kernel
sharing of ring buffers and similar, so best to get the
infrastructure going to get it right.

As a first approximation, getting remap_vmalloc_range() to do the
right thing is the best way to start this stuff off.

  reply	other threads:[~2006-11-03  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-01  1:40 Miguel Ojeda Sandonis
2006-11-02  8:51 ` Franck Bui-Huu
2006-11-02 13:44   ` Miguel Ojeda
2006-11-02 14:26     ` Franck Bui-Huu
2006-11-02 14:44       ` Miguel Ojeda
2006-11-02 19:13         ` Andrew Morton
2006-11-02 19:33           ` Miguel Ojeda
2006-11-02 20:04             ` Andrew Morton
2006-11-03  0:00               ` David Miller [this message]
2006-11-03  6:45                 ` Miguel Ojeda

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=20061102.160035.85409500.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxextreme@gmail.com \
    --cc=vagabon.xyz@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome