diff options
author | Jeff Dike <jdike@addtoit.com> | 2008-02-05 01:31:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 12:44:29 -0500 |
commit | 42a2b54ce8c7b9d4f418995a7950e7e2e15e52ce (patch) | |
tree | 30bcb0ea0a4ee6d5091b1b9a85589cff8b1863fc /arch/um/kernel | |
parent | b7c000cbc4f1fa7b82efa95b34f00c2adbeaa3fe (diff) |
uml: clean up TASK_SIZE usage
Clean up the calculation and use of the usable address space size on the host.
task_size is gone, replaced with TASK_SIZE, which is calculated from
CONFIG_TOP_ADDR. get_kmem_end and set_task_sizes_skas are also gone.
host_task_size, which refers to the entire address space usable by the UML
kernel and which may be larger than the address space usable by a UML process,
since that has to end on a pgdir boundary, is replaced by CONFIG_TOP_ADDR.
STACK_TOP is now TASK_SIZE minus the two stub pages.
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/exec.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/ksyms.c | 3 | ||||
-rw-r--r-- | arch/um/kernel/physmem.c | 10 | ||||
-rw-r--r-- | arch/um/kernel/tlb.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/um_arch.c | 22 |
5 files changed, 4 insertions, 35 deletions
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 8196450451cd..bf66b5b7bc68 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -19,7 +19,7 @@ | |||
19 | void flush_thread(void) | 19 | void flush_thread(void) |
20 | { | 20 | { |
21 | void *data = NULL; | 21 | void *data = NULL; |
22 | unsigned long end = proc_mm ? task_size : STUB_START; | 22 | unsigned long end = proc_mm ? TASK_SIZE : STUB_START; |
23 | int ret; | 23 | int ret; |
24 | 24 | ||
25 | arch_flush_thread(¤t->thread.arch); | 25 | arch_flush_thread(¤t->thread.arch); |
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c index f0ced9840a27..187a756f3e5b 100644 --- a/arch/um/kernel/ksyms.c +++ b/arch/um/kernel/ksyms.c | |||
@@ -18,11 +18,8 @@ EXPORT_SYMBOL(set_signals); | |||
18 | EXPORT_SYMBOL(get_signals); | 18 | EXPORT_SYMBOL(get_signals); |
19 | EXPORT_SYMBOL(kernel_thread); | 19 | EXPORT_SYMBOL(kernel_thread); |
20 | EXPORT_SYMBOL(sys_waitpid); | 20 | EXPORT_SYMBOL(sys_waitpid); |
21 | EXPORT_SYMBOL(task_size); | ||
22 | EXPORT_SYMBOL(flush_tlb_range); | 21 | EXPORT_SYMBOL(flush_tlb_range); |
23 | EXPORT_SYMBOL(host_task_size); | ||
24 | EXPORT_SYMBOL(arch_validate); | 22 | EXPORT_SYMBOL(arch_validate); |
25 | EXPORT_SYMBOL(get_kmem_end); | ||
26 | 23 | ||
27 | EXPORT_SYMBOL(high_physmem); | 24 | EXPORT_SYMBOL(high_physmem); |
28 | EXPORT_SYMBOL(empty_zero_page); | 25 | EXPORT_SYMBOL(empty_zero_page); |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index e66432f42485..9c9290005792 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
@@ -55,16 +55,6 @@ int __init init_maps(unsigned long physmem, unsigned long iomem, | |||
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | /* Changed during early boot */ | ||
59 | static unsigned long kmem_top = 0; | ||
60 | |||
61 | unsigned long get_kmem_end(void) | ||
62 | { | ||
63 | if (kmem_top == 0) | ||
64 | kmem_top = host_task_size - 1024 * 1024; | ||
65 | return kmem_top; | ||
66 | } | ||
67 | |||
68 | void map_memory(unsigned long virt, unsigned long phys, unsigned long len, | 58 | void map_memory(unsigned long virt, unsigned long phys, unsigned long len, |
69 | int r, int w, int x) | 59 | int r, int w, int x) |
70 | { | 60 | { |
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 96e097879f5b..429fed2f66b2 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c | |||
@@ -511,7 +511,7 @@ void flush_tlb_mm(struct mm_struct *mm) | |||
511 | if (atomic_read(&mm->mm_users) == 0) | 511 | if (atomic_read(&mm->mm_users) == 0) |
512 | return; | 512 | return; |
513 | 513 | ||
514 | end = proc_mm ? task_size : STUB_START; | 514 | end = proc_mm ? TASK_SIZE : STUB_START; |
515 | fix_range(mm, 0, end, 0); | 515 | fix_range(mm, 0, end, 0); |
516 | } | 516 | } |
517 | 517 | ||
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 1139e07b968f..9ba39ab5f4bd 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -101,8 +101,6 @@ const struct seq_operations cpuinfo_op = { | |||
101 | }; | 101 | }; |
102 | 102 | ||
103 | /* Set in linux_main */ | 103 | /* Set in linux_main */ |
104 | unsigned long host_task_size; | ||
105 | unsigned long task_size; | ||
106 | unsigned long uml_physmem; | 104 | unsigned long uml_physmem; |
107 | unsigned long uml_reserved; /* Also modified in mem_init */ | 105 | unsigned long uml_reserved; /* Also modified in mem_init */ |
108 | unsigned long start_vm; | 106 | unsigned long start_vm; |
@@ -234,20 +232,6 @@ EXPORT_SYMBOL(end_iomem); | |||
234 | 232 | ||
235 | extern char __binary_start; | 233 | extern char __binary_start; |
236 | 234 | ||
237 | static unsigned long set_task_sizes_skas(unsigned long *task_size_out) | ||
238 | { | ||
239 | /* Round up to the nearest 4M */ | ||
240 | unsigned long host_task_size = ROUND_4M((unsigned long) | ||
241 | &host_task_size); | ||
242 | |||
243 | if (!skas_needs_stub) | ||
244 | *task_size_out = host_task_size; | ||
245 | else | ||
246 | *task_size_out = STUB_START & PGDIR_MASK; | ||
247 | |||
248 | return host_task_size; | ||
249 | } | ||
250 | |||
251 | int __init linux_main(int argc, char **argv) | 235 | int __init linux_main(int argc, char **argv) |
252 | { | 236 | { |
253 | unsigned long avail, diff; | 237 | unsigned long avail, diff; |
@@ -278,8 +262,6 @@ int __init linux_main(int argc, char **argv) | |||
278 | 262 | ||
279 | printf("UML running in %s mode\n", mode); | 263 | printf("UML running in %s mode\n", mode); |
280 | 264 | ||
281 | host_task_size = set_task_sizes_skas(&task_size); | ||
282 | |||
283 | brk_start = (unsigned long) sbrk(0); | 265 | brk_start = (unsigned long) sbrk(0); |
284 | 266 | ||
285 | /* | 267 | /* |
@@ -304,7 +286,7 @@ int __init linux_main(int argc, char **argv) | |||
304 | 286 | ||
305 | highmem = 0; | 287 | highmem = 0; |
306 | iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; | 288 | iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK; |
307 | max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC; | 289 | max_physmem = CONFIG_TOP_ADDR - uml_physmem - iomem_size - MIN_VMALLOC; |
308 | 290 | ||
309 | /* | 291 | /* |
310 | * Zones have to begin on a 1 << MAX_ORDER page boundary, | 292 | * Zones have to begin on a 1 << MAX_ORDER page boundary, |
@@ -336,7 +318,7 @@ int __init linux_main(int argc, char **argv) | |||
336 | } | 318 | } |
337 | 319 | ||
338 | virtmem_size = physmem_size; | 320 | virtmem_size = physmem_size; |
339 | avail = get_kmem_end() - start_vm; | 321 | avail = CONFIG_TOP_ADDR - start_vm; |
340 | if (physmem_size > avail) | 322 | if (physmem_size > avail) |
341 | virtmem_size = avail; | 323 | virtmem_size = avail; |
342 | end_vm = start_vm + virtmem_size; | 324 | end_vm = start_vm + virtmem_size; |