]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm/slice: Fix off-by-1 error when computing slice mask
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 21 Mar 2017 17:29:52 +0000 (22:59 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 31 Mar 2017 12:09:48 +0000 (23:09 +1100)
commitd5e900ddce05e79f8fe5c55235577e3842b66512
treef6c3d6cc46171c12e3b0a2b353b03dbccb890f38
parent9286ad58344f6a19231c70800d1d6f495f49e489
powerpc/mm/slice: Fix off-by-1 error when computing slice mask

For low slice, max addr should be less than 4G. Without limiting this correctly
we will end up with a low slice mask which has 17th bit set. This is not
a problem with the current code because our low slice mask is of type u16. But
in later patch I am switching low slice mask to u64 type and having the 17bit
set result in wrong slice mask which in turn results in mmap failures.

Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/slice.c