diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
commit | 7b70c4275f28702b76b273c8534c38f8313812e9 (patch) | |
tree | 1df2229ca02466bd1adda814ac5c37aa0a597db1 /arch/arm/mm | |
parent | ceb0885d3b01bb2e2f18765770e212914f2864be (diff) | |
parent | a20df564d15bd28e3df24e1c65b885bd74d23f17 (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
arch/arm/kernel/entry-armv.S
arch/arm/kernel/setup.c
arch/arm/mm/init.c
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/init.c | 19 | ||||
-rw-r--r-- | arch/arm/mm/mmap.c | 4 |
2 files changed, 13 insertions, 10 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 240b68d511d..7185b00650f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -398,28 +398,27 @@ static void __init free_unused_memmap(struct meminfo *mi) | |||
398 | unsigned int i; | 398 | unsigned int i; |
399 | 399 | ||
400 | /* | 400 | /* |
401 | * [FIXME] This relies on each bank being in address order. This | 401 | * This relies on each bank being in address order. |
402 | * may not be the case, especially if the user has provided the | 402 | * The banks are sorted previously in bootmem_init(). |
403 | * information on the command line. | ||
404 | */ | 403 | */ |
405 | for_each_bank(i, mi) { | 404 | for_each_bank(i, mi) { |
406 | struct membank *bank = &mi->bank[i]; | 405 | struct membank *bank = &mi->bank[i]; |
407 | 406 | ||
408 | bank_start = bank_pfn_start(bank); | 407 | bank_start = bank_pfn_start(bank); |
409 | if (bank_start < prev_bank_end) { | ||
410 | printk(KERN_ERR "MEM: unordered memory banks. " | ||
411 | "Not freeing memmap.\n"); | ||
412 | break; | ||
413 | } | ||
414 | 408 | ||
415 | /* | 409 | /* |
416 | * If we had a previous bank, and there is a space | 410 | * If we had a previous bank, and there is a space |
417 | * between the current bank and the previous, free it. | 411 | * between the current bank and the previous, free it. |
418 | */ | 412 | */ |
419 | if (prev_bank_end && prev_bank_end != bank_start) | 413 | if (prev_bank_end && prev_bank_end < bank_start) |
420 | free_memmap(prev_bank_end, bank_start); | 414 | free_memmap(prev_bank_end, bank_start); |
421 | 415 | ||
422 | prev_bank_end = bank_pfn_end(bank); | 416 | /* |
417 | * Align up here since the VM subsystem insists that the | ||
418 | * memmap entries are valid from the bank end aligned to | ||
419 | * MAX_ORDER_NR_PAGES. | ||
420 | */ | ||
421 | prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES); | ||
423 | } | 422 | } |
424 | } | 423 | } |
425 | 424 | ||
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index f5abc51c5a0..4f5b39687df 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/shm.h> | 7 | #include <linux/shm.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/random.h> | ||
10 | #include <asm/cputype.h> | 11 | #include <asm/cputype.h> |
11 | #include <asm/system.h> | 12 | #include <asm/system.h> |
12 | 13 | ||
@@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
80 | start_addr = addr = TASK_UNMAPPED_BASE; | 81 | start_addr = addr = TASK_UNMAPPED_BASE; |
81 | mm->cached_hole_size = 0; | 82 | mm->cached_hole_size = 0; |
82 | } | 83 | } |
84 | /* 8 bits of randomness in 20 address space bits */ | ||
85 | if (current->flags & PF_RANDOMIZE) | ||
86 | addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; | ||
83 | 87 | ||
84 | full_search: | 88 | full_search: |
85 | if (do_align) | 89 | if (do_align) |