All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: set MAX_PHYSMEM_BITS to 32 for !LPAE
@ 2026-07-24  6:30 Karl Mehltretter
  2026-07-24  7:23 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Mehltretter @ 2026-07-24  6:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Karl Mehltretter, Russell King, Arnd Bergmann, Kevin Cernekee,
	Gregory Fong

The default MAX_PHYSMEM_BITS of 36 was introduced for LPAE platforms,
but also applies to non-LPAE ARM, which has 32-bit physical addresses.
With GET_FREE_REGION and CONFIG_WERROR, this causes:

  error: conversion from 'long long unsigned int' to 'resource_size_t'
  changes value from '68719476735' to '4294967295'

Use a 36-bit default only for LPAE builds.

Fixes: db57f88e4ccb ("ARM: 8411/1: Add default SPARSEMEM settings")
Assisted-by: Claude:claude-fable-5
---
 arch/arm/include/asm/sparsemem.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/sparsemem.h b/arch/arm/include/asm/sparsemem.h
index 421e3415338a..6b512be3a34a 100644
--- a/arch/arm/include/asm/sparsemem.h
+++ b/arch/arm/include/asm/sparsemem.h
@@ -19,7 +19,11 @@
  * These can be overridden in your mach/memory.h.
  */
 #if !defined(MAX_PHYSMEM_BITS) || !defined(SECTION_SIZE_BITS)
+#ifdef CONFIG_ARM_LPAE
 #define MAX_PHYSMEM_BITS	36
+#else
+#define MAX_PHYSMEM_BITS	32
+#endif
 #define SECTION_SIZE_BITS	28
 #endif
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-24  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  6:30 [PATCH] ARM: set MAX_PHYSMEM_BITS to 32 for !LPAE Karl Mehltretter
2026-07-24  7:23 ` Arnd Bergmann
2026-07-24  7:50   ` Karl Mehltretter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.