public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Problem with map_user_kiobuf() not mapping to physical memory
  2001-05-02 15:33 Problem with map_user_kiobuf() not mapping to physical memory Terry Barnaby
@ 2001-05-02 14:34 ` Bjorn Wesen
  2001-05-02 19:17 ` Gerd Knorr
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Wesen @ 2001-05-02 14:34 UTC (permalink / raw)
  To: Terry Barnaby; +Cc: linux-kernel

On Wed, 2 May 2001, Terry Barnaby wrote:
> However, I note that if the user just mallocs memory and does not access
> it
> (No physical memory pages created) and then passes this virtual address
> space
> to the driver which performs a map_user_kiobuf() on it, the resulting
> kiobuf
> structure has all of the pagelist[] physical address entries set to the
> same value
> and the maplist[] entries set to 0. The devices access to this memory
> now
> causes system problems.
> Is map_user_kiobuf() working correctly ?
> Should I call some function to map the virtual address space into
> physical memory
> or at least pages before I call map_user_kiobuf() ?

No.. but you might just have done something wrong.

See the example in arch/cris/drivers/examples/kiobuftest.c

(that example does not deallocate the vectors properly IIRC, but the
actual kiobuf mapping sequence should work)

/BW


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Problem with map_user_kiobuf() not mapping to physical memory
@ 2001-05-02 15:33 Terry Barnaby
  2001-05-02 14:34 ` Bjorn Wesen
  2001-05-02 19:17 ` Gerd Knorr
  0 siblings, 2 replies; 3+ messages in thread
From: Terry Barnaby @ 2001-05-02 15:33 UTC (permalink / raw)
  To: linux-kernel

We are developing a Linux driver which allows a device to read/write
directly
into a processes virtual memory space.
I have a question on using map_user_kiobuf() as we are having problems.
I was under the impression that if I used map_user_kiobuf() this would
map
the users virtual address space into locked physical memory pages so
that
I/O could be performed.
However, I note that if the user just mallocs memory and does not access
it
(No physical memory pages created) and then passes this virtual address
space
to the driver which performs a map_user_kiobuf() on it, the resulting
kiobuf
structure has all of the pagelist[] physical address entries set to the
same value
and the maplist[] entries set to 0. The devices access to this memory
now
causes system problems.
Is map_user_kiobuf() working correctly ?
Should I call some function to map the virtual address space into
physical memory
or at least pages before I call map_user_kiobuf() ?

Cheers

Terry

--
  Dr Terry Barnaby                     BEAM Ltd
  Phone: +44 1454 324512               Northavon Business Center, Dean Rd
  Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
  Email: terry@beam.demon.co.uk        Web: www.beam.demon.co.uk
  BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software Dev
                         "Tandems are twice the fun !"




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with map_user_kiobuf() not mapping to physical memory
  2001-05-02 15:33 Problem with map_user_kiobuf() not mapping to physical memory Terry Barnaby
  2001-05-02 14:34 ` Bjorn Wesen
@ 2001-05-02 19:17 ` Gerd Knorr
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Knorr @ 2001-05-02 19:17 UTC (permalink / raw)
  To: linux-kernel

>  to the driver which performs a map_user_kiobuf() on it, the resulting
>  kiobuf
>  structure has all of the pagelist[] physical address entries set to the
>  same value
>  and the maplist[] entries set to 0. The devices access to this memory
>  now
>  causes system problems.
>  Is map_user_kiobuf() working correctly ?

Yes, it is.  You have to lock down the pages for I/O with
lock_kiovec() before using the maplist.  The locking will
also fault the pages if needed.

  Gerd

-- 
sigfault (core dumped)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-02 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-02 15:33 Problem with map_user_kiobuf() not mapping to physical memory Terry Barnaby
2001-05-02 14:34 ` Bjorn Wesen
2001-05-02 19:17 ` Gerd Knorr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox