Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54228
b: refs/heads/master
c: d506a77
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed May 7, 2007
1 parent 234a48a commit 945ee0b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b45ab3398a0ba119b1f672c7c56fd5a431b7f0a
refs/heads/master: d506a7725114aaddbf982fd18621b3e0e5c27f1b
21 changes: 21 additions & 0 deletions trunk/arch/powerpc/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,13 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
if (len > TASK_SIZE)
return -ENOMEM;

/* handle fixed mapping: prevent overlap with huge pages */
if (flags & MAP_FIXED) {
if (is_hugepage_only_range(mm, addr, len))
return -EINVAL;
return addr;
}

if (addr) {
addr = PAGE_ALIGN(addr);
vma = find_vma(mm, addr);
Expand Down Expand Up @@ -641,6 +648,13 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
if (len > TASK_SIZE)
return -ENOMEM;

/* handle fixed mapping: prevent overlap with huge pages */
if (flags & MAP_FIXED) {
if (is_hugepage_only_range(mm, addr, len))
return -EINVAL;
return addr;
}

/* dont allow allocations above current base */
if (mm->free_area_cache > base)
mm->free_area_cache = base;
Expand Down Expand Up @@ -823,6 +837,13 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
/* Paranoia, caller should have dealt with this */
BUG_ON((addr + len) < addr);

/* Handle MAP_FIXED */
if (flags & MAP_FIXED) {
if (prepare_hugepage_range(addr, len, pgoff))
return -EINVAL;
return addr;
}

if (test_thread_flag(TIF_32BIT)) {
curareas = current->mm->context.low_htlb_areas;

Expand Down

0 comments on commit 945ee0b

Please sign in to comment.