Subject: Re: [v2, 1/5] powerpc/64s/hash: Fix 128TB-512TB virtual address boundary case allocation

From: Michael Ellerman <[email-masked]>
Date: Tue, 14 Nov 2017 22:12:21 +1100 (AEDT)

On Thu, 2017-11-09 at 17:27:36 UTC, Nicholas Piggin wrote:
> When allocating VA space with a hint that crosses 128TB, the SLB addr_limit
> variable is not expanded if addr is not > 128TB, but the slice allocation
> looks at task_size, which is 512TB. This results in slice_check_fit()
> incorrectly succeeding because the slice_count truncates off bit 128 of the
> requested mask, so the comparison to the available mask succeeds.
> 
> Fix this by using mm->context.addr_limit instead of mm->task_size for
> testing allocation limits. This causes such allocations to fail.
> 
> Cc: "Aneesh Kumar K.V" <[email-masked]>
> Fixes: f4ea6dcb08 ("powerpc/mm: Enable mappings above 128TB")
> Reported-by: Florian Weimer <[email-masked]>
> Signed-off-by: Nicholas Piggin <[email-masked]>
> Reviewed-by: Aneesh Kumar K.V <[email-masked]>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/6a72dc038b615229a1b285829d6c83

cheers