diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 01:26:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:43:04 -0700 |
commit | 5c8aaceab88ac787c0a4038b29143c954c2a45e0 (patch) | |
tree | 9277518e77cac9e1f97d826fa8962d1c861a9e40 /arch/um/kernel | |
parent | 8d82076080d909f18dea859a6767df7e3ff69241 (diff) |
uml: stop specially protecting kernel stacks
Map all of physical memory as executable to avoid having to change stack
protections during fork and exit.
unprotect_stack is now called only from MODE_TT code, so it is marked as such.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r-- | arch/um/kernel/init_task.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/physmem.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c index cba516e6c99..fa90db964b2 100644 --- a/arch/um/kernel/init_task.c +++ b/arch/um/kernel/init_task.c @@ -47,7 +47,9 @@ union thread_union cpu0_irqstack __attribute__((__section__(".data.init_irqstack"))) = { INIT_THREAD_INFO(init_task) }; +#ifdef CONFIG_MODE_TT void unprotect_stack(unsigned long stack) { os_protect_memory((void *) stack, THREAD_SIZE, 1, 1, 0); } +#endif diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 5ee7e851bbc..8aeac4d9351 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -105,7 +105,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, offset = uml_reserved - uml_physmem; err = os_map_memory((void *) uml_reserved, physmem_fd, offset, - len - offset, 1, 1, 0); + len - offset, 1, 1, 1); if(err < 0){ os_print_error(err, "Mapping memory"); exit(1); diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index bfa52f206bb..f083787410a 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -82,9 +82,9 @@ unsigned long alloc_stack(int order, int atomic) if (atomic) flags = GFP_ATOMIC; page = __get_free_pages(flags, order); - if(page == 0) + if (page == 0) return 0; - stack_protections(page); + return page; } @@ -141,7 +141,6 @@ void release_thread(struct task_struct *task) void exit_thread(void) { - unprotect_stack((unsigned long) current_thread); } void *get_current(void) |