Re: [PATCH] linux-2.5.43_vsyscall_A0

Andi Kleen
2002-10-22T04:11:09Z

> > My problem is that mapping user code into the vsyscall fixmap is
> > complex and not very clean at all, breaks various concepts in the mm
> > and last but not the least it is slow
>
> Can you explain, in small words, why mapping user code is so horrible?

Currently Linux has neatly separated kernel and user page tables.
On architectures which have tree type tables in hardware you just have
a user level table and you stick a pointer to the kernel level tables
somewhere at the end of the first page. The normal user level page
handling doesn't know about the kernel pages. The vsyscall code is in
the kernel mapping in the fixmaps. Allowing the user to map arbitary
pages into the vsyscall area would blur this clear separation and
require much more special case handling.

In addition it would break a lot of assumptions that user mappings are
only < __PAGE_OFFSET, probably having security implications. For example
you would need to special case this in uaccess.h's access_ok(), which
would be quite a lot of overhead (any change to this function causes
many KB of binary bloat because *_user is so heavily used all over the kernel)

-Andi