summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/mmu.h
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-03-17 01:17:56 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2019-03-21 00:16:45 +1100
commit8bc086899816214fbc6047c9c7e15fcab49552bf (patch)
tree4b4bbe2ee9e08db4b28fb9c835fdf5b767f85baf /arch/powerpc/include/asm/mmu.h
parent4622a2d43101ea2e3d54a2af090f25a5886c648b (diff)
downloadlinux-8bc086899816214fbc6047c9c7e15fcab49552bf.tar.gz
linux-8bc086899816214fbc6047c9c7e15fcab49552bf.tar.bz2
linux-8bc086899816214fbc6047c9c7e15fcab49552bf.zip
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 4ffe713b7587 ("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: 4ffe713b7587 ("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>
Diffstat (limited to 'arch/powerpc/include/asm/mmu.h')
-rw-r--r--arch/powerpc/include/asm/mmu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index d34ad1657d7b..598cdcdd1355 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -352,7 +352,7 @@ static inline bool strict_kernel_rwx_enabled(void)
#if defined(CONFIG_SPARSEMEM_VMEMMAP) && defined(CONFIG_SPARSEMEM_EXTREME) && \
defined (CONFIG_PPC_64K_PAGES)
#define MAX_PHYSMEM_BITS 51
-#else
+#elif defined(CONFIG_SPARSEMEM)
#define MAX_PHYSMEM_BITS 46
#endif