Skip to content

Commit 8bc0868

Browse files
bwhacksmpe
authored andcommitted
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 4ffe713 ("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: 4ffe713 ("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>
1 parent 4622a2d commit 8bc0868

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/include/asm

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static inline bool strict_kernel_rwx_enabled(void)
352352
#if defined(CONFIG_SPARSEMEM_VMEMMAP) && defined(CONFIG_SPARSEMEM_EXTREME) && \
353353
defined (CONFIG_PPC_64K_PAGES)
354354
#define MAX_PHYSMEM_BITS 51
355-
#else
355+
#elif defined(CONFIG_SPARSEMEM)
356356
#define MAX_PHYSMEM_BITS 46
357357
#endif
358358

0 commit comments

Comments
 (0)