Re: Address translation

2000-11-24 Thread Andreas Bombe
On Thu, Nov 23, 2000 at 10:04:18PM +0100, Bjorn Wesen wrote: > On Thu, 23 Nov 2000, Andreas Bombe wrote: > > > I may be wrong on this, but I thought that copy_{to,from}_user are > > > only necessary if the address range you are accessing might cause a > > > fault which Linux cannot handle (ie. one

Re: Address translation

2000-11-23 Thread Pavel Machek
Hi! > otherwise valid) I think the access macros are unnecessary. I would be > *very* glad if someone could confirm this, or shoot me down. :) > > For instance, a kernel module I am writing allocates some memory in > the current process's address space as follows: > > down(&mm->mmap_sem); >

Re: Address translation

2000-11-23 Thread Bjorn Wesen
On Thu, 23 Nov 2000, Andreas Bombe wrote: > > I may be wrong on this, but I thought that copy_{to,from}_user are > > only necessary if the address range you are accessing might cause a > > fault which Linux cannot handle (ie. one which would cause the > > application to segfault if it accessed tha

Re: Address translation

2000-11-23 Thread Andreas Bombe
On Wed, Nov 22, 2000 at 09:39:51PM +, Keir Fraser wrote: > > The reason that everyone else uses copy_{to,from}_user is that there > > is no way to guarantee that the userspace pointer is valid. That > > memory may have been swapped out. The copy macros are prepared to > > fault the memory in.

Re: Address translation

2000-11-22 Thread Keir Fraser
> The reason that everyone else uses copy_{to,from}_user is that there > is no way to guarantee that the userspace pointer is valid. That > memory may have been swapped out. The copy macros are prepared to > fault the memory in. The rest of the kernel is not. > > Jeff I may be wrong on this, but

Re: Address translation

2000-11-21 Thread Jeff Dike
[EMAIL PROTECTED] said: > Does anybody know a function or method in order to translate an user > space pointer into a valid pointer in kernel mode? > I'd like to avoid copying data (such as the 'copy_to_user' and > 'copy_from_user' functions do) because it slows down my system. The reason