diff options
author | Paul Mackerras <paulus@samba.org> | 2007-05-07 23:37:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-07 23:37:51 -0400 |
commit | 02bbc0f09c90cefdb2837605c96a66c5ce4ba2e1 (patch) | |
tree | 04ef573cd4de095c500c9fc3477f4278c0b36300 /arch/powerpc/mm | |
parent | 7487a2245b8841c77ba9db406cf99a483b9334e9 (diff) | |
parent | 5b94f675f57e4ff16c8fda09088d7480a84dcd91 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 24 | ||||
-rw-r--r-- | arch/powerpc/mm/init_64.c | 3 |
2 files changed, 23 insertions, 4 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 8508f973d9cc..1f07f70ac89f 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -566,6 +566,13 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
566 | if (len > TASK_SIZE) | 566 | if (len > TASK_SIZE) |
567 | return -ENOMEM; | 567 | return -ENOMEM; |
568 | 568 | ||
569 | /* handle fixed mapping: prevent overlap with huge pages */ | ||
570 | if (flags & MAP_FIXED) { | ||
571 | if (is_hugepage_only_range(mm, addr, len)) | ||
572 | return -EINVAL; | ||
573 | return addr; | ||
574 | } | ||
575 | |||
569 | if (addr) { | 576 | if (addr) { |
570 | addr = PAGE_ALIGN(addr); | 577 | addr = PAGE_ALIGN(addr); |
571 | vma = find_vma(mm, addr); | 578 | vma = find_vma(mm, addr); |
@@ -641,6 +648,13 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
641 | if (len > TASK_SIZE) | 648 | if (len > TASK_SIZE) |
642 | return -ENOMEM; | 649 | return -ENOMEM; |
643 | 650 | ||
651 | /* handle fixed mapping: prevent overlap with huge pages */ | ||
652 | if (flags & MAP_FIXED) { | ||
653 | if (is_hugepage_only_range(mm, addr, len)) | ||
654 | return -EINVAL; | ||
655 | return addr; | ||
656 | } | ||
657 | |||
644 | /* dont allow allocations above current base */ | 658 | /* dont allow allocations above current base */ |
645 | if (mm->free_area_cache > base) | 659 | if (mm->free_area_cache > base) |
646 | mm->free_area_cache = base; | 660 | mm->free_area_cache = base; |
@@ -823,6 +837,13 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
823 | /* Paranoia, caller should have dealt with this */ | 837 | /* Paranoia, caller should have dealt with this */ |
824 | BUG_ON((addr + len) < addr); | 838 | BUG_ON((addr + len) < addr); |
825 | 839 | ||
840 | /* Handle MAP_FIXED */ | ||
841 | if (flags & MAP_FIXED) { | ||
842 | if (prepare_hugepage_range(addr, len, pgoff)) | ||
843 | return -EINVAL; | ||
844 | return addr; | ||
845 | } | ||
846 | |||
826 | if (test_thread_flag(TIF_32BIT)) { | 847 | if (test_thread_flag(TIF_32BIT)) { |
827 | curareas = current->mm->context.low_htlb_areas; | 848 | curareas = current->mm->context.low_htlb_areas; |
828 | 849 | ||
@@ -1057,8 +1078,7 @@ static int __init hugetlbpage_init(void) | |||
1057 | huge_pgtable_cache = kmem_cache_create("hugepte_cache", | 1078 | huge_pgtable_cache = kmem_cache_create("hugepte_cache", |
1058 | HUGEPTE_TABLE_SIZE, | 1079 | HUGEPTE_TABLE_SIZE, |
1059 | HUGEPTE_TABLE_SIZE, | 1080 | HUGEPTE_TABLE_SIZE, |
1060 | SLAB_HWCACHE_ALIGN | | 1081 | 0, |
1061 | SLAB_MUST_HWCACHE_ALIGN, | ||
1062 | zero_ctor, NULL); | 1082 | zero_ctor, NULL); |
1063 | if (! huge_pgtable_cache) | 1083 | if (! huge_pgtable_cache) |
1064 | panic("hugetlbpage_init(): could not create hugepte cache\n"); | 1084 | panic("hugetlbpage_init(): could not create hugepte cache\n"); |
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index d12a87ec5ae9..4416d5140c53 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -183,8 +183,7 @@ void pgtable_cache_init(void) | |||
183 | "for size: %08x...\n", name, i, size); | 183 | "for size: %08x...\n", name, i, size); |
184 | pgtable_cache[i] = kmem_cache_create(name, | 184 | pgtable_cache[i] = kmem_cache_create(name, |
185 | size, size, | 185 | size, size, |
186 | SLAB_HWCACHE_ALIGN | | 186 | 0, |
187 | SLAB_MUST_HWCACHE_ALIGN, | ||
188 | zero_ctor, | 187 | zero_ctor, |
189 | NULL); | 188 | NULL); |
190 | if (! pgtable_cache[i]) | 189 | if (! pgtable_cache[i]) |