stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "powerpc/64s/hash: Fix 512T hint detection to use >= 128T" has been added to the 4.14-stable tree
@ 2017-11-27 17:08 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-27 17:08 UTC (permalink / raw)
  To: mpe, aneesh.kumar, gregkh, npiggin; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    powerpc/64s/hash: Fix 512T hint detection to use >= 128T

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-64s-hash-fix-512t-hint-detection-to-use-128t.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 7ece370996b694ae263025e056ad785afc1be5ab Mon Sep 17 00:00:00 2001
From: Michael Ellerman <mpe@ellerman.id.au>
Date: Mon, 13 Nov 2017 23:17:28 +1100
Subject: powerpc/64s/hash: Fix 512T hint detection to use >= 128T

From: Michael Ellerman <mpe@ellerman.id.au>

commit 7ece370996b694ae263025e056ad785afc1be5ab upstream.

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")
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/mm/slice.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -419,7 +419,7 @@ unsigned long slice_get_unmapped_area(un
 	/*
 	 * Check if we need to expland slice area.
 	 */
-	if (unlikely(addr > mm->context.addr_limit &&
+	if (unlikely(addr >= mm->context.addr_limit &&
 		     mm->context.addr_limit != TASK_SIZE)) {
 		mm->context.addr_limit = TASK_SIZE;
 		on_each_cpu(slice_flush_segments, mm, 1);
@@ -427,7 +427,7 @@ unsigned long slice_get_unmapped_area(un
 	/*
 	 * This mmap request can allocate upt to 512TB
 	 */
-	if (addr > DEFAULT_MAP_WINDOW)
+	if (addr >= DEFAULT_MAP_WINDOW)
 		high_limit = mm->context.addr_limit;
 	else
 		high_limit = DEFAULT_MAP_WINDOW;


Patches currently in stable-queue which might be from mpe@ellerman.id.au are

queue-4.14/powerpc-perf-imc-use-cpu_to_node-not-topology_physical_package_id.patch
queue-4.14/powerpc-64s-hash-fix-128tb-512tb-virtual-address-boundary-case-allocation.patch
queue-4.14/powerpc-fix-boot-on-book3s_32-with-config_strict_kernel_rwx.patch
queue-4.14/powerpc-64s-hash-fix-fork-with-512tb-process-address-space.patch
queue-4.14/powerpc-mm-radix-fix-crashes-on-power9-dd1-with-radix-mmu-and-strict_rwx.patch
queue-4.14/powerpc-64s-radix-fix-128tb-512tb-virtual-address-boundary-case-allocation.patch
queue-4.14/powerpc-signal-properly-handle-return-value-from-uprobe_deny_signal.patch
queue-4.14/powerpc-64s-hash-allow-map_fixed-allocations-to-cross-128tb-boundary.patch
queue-4.14/powerpc-64s-hash-fix-512t-hint-detection-to-use-128t.patch
queue-4.14/powerpc-64s-fix-masking-of-srr1-bits-on-instruction-fault.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-27 17:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-27 17:08 Patch "powerpc/64s/hash: Fix 512T hint detection to use >= 128T" has been added to the 4.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).