lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 31 Jul 2008 09:43:59 +0300
From:	Avi Kivity <avi@...ranet.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	Adrian Bunk <bunk@...nel.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	lguest <lguest@...abs.org>, linux-kernel@...r.kernel.org,
	Nick Piggin <nickpiggin@...oo.com.au>
Subject: Re: [PATCH 1/2] Export get_user_pages_fast

Andrew Morton wrote:
> That is how it is presently implemented.
>
>   

Cool.

> #ifdef CONFIG_HAVE_GET_USER_PAGES_FAST
> /*
>  * get_user_pages_fast provides equivalent functionality to get_user_pages,
>  * operating on current and current->mm (force=0 and doesn't return any vmas).
>  *
>  * get_user_pages_fast may take mmap_sem and page tables, so no assumptions
>  * can be made about locking. get_user_pages_fast is to be implemented in a
>  * way that is advantageous (vs get_user_pages()) when the user memory area is
>  * already faulted in and present in ptes. However if the pages have to be
>  * faulted in, it may turn out to be slightly slower).
>  */
> int get_user_pages_fast(unsigned long start, int nr_pages, int write,
> 			struct page **pages);
>
> #else
> /*
>  * Should probably be moved to asm-generic, and architectures can include it if
>  * they don't implement their own get_user_pages_fast.
>  */
> #define get_user_pages_fast(start, nr_pages, write, pages)	\
> ({								\
> 	struct mm_struct *mm = current->mm;			\
> 	int ret;						\
> 								\
> 	down_read(&mm->mmap_sem);				\
> 	ret = get_user_pages(current, mm, start, nr_pages,	\
> 					write, 0, pages, NULL);	\
> 	up_read(&mm->mmap_sem);					\
> 								\
> 	ret;							\
> })
> #endif
>
>   

Surprised.  Why not an out-of-line function?  Would eliminate the 
present discussion as well.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ