diff options
author | Jeff Dike <jdike@addtoit.com> | 2008-05-12 17:01:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-13 11:02:22 -0400 |
commit | 60a2988aea701a6424809a5432bf068667aac177 (patch) | |
tree | f92bef2b181ec19e8c73cd489c93a21408fab15a /arch/um/kernel | |
parent | a7dfa9403bf3b03899d5ef5d10b0c5c3f74b0682 (diff) |
uml: physical memory shouldn't include initial stack
The top of physical memory should be below the initial process stack, not the
top of the address space, at least for as long as the stack isn't known to the
kernel VM system and appropriately reserved.
Cc: "Christopher S. Aker" <caker@theshore.net>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: WANG Cong <xiyou.wangcong@gmail.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/um_arch.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 82058ac7d481..9db85b2ce698 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -258,6 +258,7 @@ int __init linux_main(int argc, char **argv) | |||
258 | { | 258 | { |
259 | unsigned long avail, diff; | 259 | unsigned long avail, diff; |
260 | unsigned long virtmem_size, max_physmem; | 260 | unsigned long virtmem_size, max_physmem; |
261 | unsigned long stack; | ||
261 | unsigned int i; | 262 | unsigned int i; |
262 | int add; | 263 | int add; |
263 | char * mode; | 264 | char * mode; |
@@ -348,7 +349,9 @@ int __init linux_main(int argc, char **argv) | |||
348 | } | 349 | } |
349 | 350 | ||
350 | virtmem_size = physmem_size; | 351 | virtmem_size = physmem_size; |
351 | avail = TASK_SIZE - start_vm; | 352 | stack = (unsigned long) argv; |
353 | stack &= ~(1024 * 1024 - 1); | ||
354 | avail = stack - start_vm; | ||
352 | if (physmem_size > avail) | 355 | if (physmem_size > avail) |
353 | virtmem_size = avail; | 356 | virtmem_size = avail; |
354 | end_vm = start_vm + virtmem_size; | 357 | end_vm = start_vm + virtmem_size; |