aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2017-11-13 07:17:28 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2017-11-13 07:34:06 -0500
commit7ece370996b694ae263025e056ad785afc1be5ab (patch)
treeb17550158c0e7bc6010630a5fbbd25e595d1a03f
parentf23ab3efb1b30cc5c5ef5ae4ef294ed467f30675 (diff)
powerpc/64s/hash: Fix 512T hint detection to use >= 128T
Currently userspace is able to request mmap() search between 128T-512T by specifying a hint address that is greater than 128T. But that means a hint of 128T exactly will return an address below 128T, which is confusing and wrong. So fix the logic to check the hint is greater than *or equal* to 128T. Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") Cc: stable@vger.kernel.org # v4.12+ Suggested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Suggested-by: Nicholas Piggin <npiggin@gmail.com> [mpe: Split out of Nick's bigger patch] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/mm/slice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 45f6740dd407..48a5312103a1 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -419,7 +419,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
419 /* 419 /*
420 * Check if we need to expland slice area. 420 * Check if we need to expland slice area.
421 */ 421 */
422 if (unlikely(addr > mm->context.addr_limit && 422 if (unlikely(addr >= mm->context.addr_limit &&
423 mm->context.addr_limit != TASK_SIZE)) { 423 mm->context.addr_limit != TASK_SIZE)) {
424 mm->context.addr_limit = TASK_SIZE; 424 mm->context.addr_limit = TASK_SIZE;
425 on_each_cpu(slice_flush_segments, mm, 1); 425 on_each_cpu(slice_flush_segments, mm, 1);
@@ -427,7 +427,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
427 /* 427 /*
428 * This mmap request can allocate upt to 512TB 428 * This mmap request can allocate upt to 512TB
429 */ 429 */
430 if (addr > DEFAULT_MAP_WINDOW) 430 if (addr >= DEFAULT_MAP_WINDOW)
431 high_limit = mm->context.addr_limit; 431 high_limit = mm->context.addr_limit;
432 else 432 else
433 high_limit = DEFAULT_MAP_WINDOW; 433 high_limit = DEFAULT_MAP_WINDOW;