Looking at the stack setup code, we have other things we probably might
want to look at.
For example, we do that "mprotect_fixup()" to fix up possible vm_flags
issues (notably whether execute bit is set or not), and that's absolutely
something that we probably should do at the same time as moving the stack,
so that we don't end up walking - and changing - the page tables _twice_.
So the stack setup really is a total special case, and it looks like we do
some rather stupid things there. Havign a specialized routine that does
just:
- if we're moving things, fill in the new page tables (we know they are
dense, so my "stupid" routine actually does the right thing despite
being pretty simplistic) before moving.
- if we're moving _or_ changing protections, do a
for_each_page()
move_andor_fix_protection()
which kind of looks like the current "move_page_tables()", except we
know it doesn't need new allocations.
Hmm?
Linus
--