diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2017-04-13 21:18:21 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-04-19 12:00:18 +0200 |
commit | be77e999e3937322b7e15274b8fc7da309a040a0 (patch) | |
tree | e850b22d9ee7ae37a8e5b8ceb6f16fad8ae1b7e3 /arch/powerpc/mm/hugetlbpage-radix.c | |
parent | powerpc/64s: Revert setting of LPCR[LPES] on POWER9 (diff) | |
download | linux-be77e999e3937322b7e15274b8fc7da309a040a0.tar.xz linux-be77e999e3937322b7e15274b8fc7da309a040a0.zip |
powerpc/mm/radix: Use mm->task_size for boundary checking instead of addr_limit
We don't init addr_limit correctly for 32 bit applications. So default to using
mm->task_size for boundary condition checking. We use addr_limit to only control
free space search. This makes sure that we do the right thing with 32 bit
applications.
We should consolidate the usage of TASK_SIZE/mm->task_size and
mm->context.addr_limit later.
This partially reverts commit fbfef9027c2a7ad (powerpc/mm: Switch some
TASK_SIZE checks to use mm_context addr_limit).
Fixes: fbfef9027c2a ("powerpc/mm: Switch some TASK_SIZE checks to use mm_context addr_limit")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/hugetlbpage-radix.c')
-rw-r--r-- | arch/powerpc/mm/hugetlbpage-radix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c index 0aa9cade422f..6575b9aabef4 100644 --- a/arch/powerpc/mm/hugetlbpage-radix.c +++ b/arch/powerpc/mm/hugetlbpage-radix.c @@ -55,7 +55,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, if (len & ~huge_page_mask(h)) return -EINVAL; - if (len > mm->context.addr_limit) + if (len > mm->task_size) return -ENOMEM; if (flags & MAP_FIXED) { @@ -67,7 +67,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, if (addr) { addr = ALIGN(addr, huge_page_size(h)); vma = find_vma(mm, addr); - if (mm->context.addr_limit - len >= addr && + if (mm->task_size - len >= addr && (!vma || addr + len <= vma->vm_start)) return addr; } |