]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations
authorBen Hutchings <ben@decadent.org.uk>
Sun, 17 Mar 2019 01:17:56 +0000 (01:17 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 20 Mar 2019 13:16:45 +0000 (00:16 +1100)
commit8f95edd7790a1f0d5db6db24cbb492eced05e592
tree4b4bbe2ee9e08db4b28fb9c835fdf5b767f85baf
parentb2d8832b0f6251989066aeb4068da04e47ebc8d4
powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations

MAX_PHYSMEM_BITS only needs to be defined if CONFIG_SPARSEMEM is
enabled, and that was the case before commit 6367b55cc41e
("powerpc/mm: Increase the max addressable memory to 2PB").

On 32-bit systems, where CONFIG_SPARSEMEM is not enabled, we now
define it as 46.  That is larger than the real number of physical
address bits, and breaks calculations in zsmalloc:

  mm/zsmalloc.c:130:49: warning: right shift count is negative
    MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS))
                                                   ^~
  ...
  mm/zsmalloc.c:253:21: error: variably modified 'size_class' at file scope
    struct size_class *size_class[ZS_SIZE_CLASSES];
                       ^~~~~~~~~~

Fixes: 6367b55cc41e ("powerpc/mm: Increase the max addressable memory to 2PB")
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/mmu.h