* [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
* Re: [PATCH] ARM: set MAX_PHYSMEM_BITS to 32 for !LPAE
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
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2026-07-24 7:23 UTC (permalink / raw)
To: Karl Mehltretter, linux-arm-kernel
Cc: Russell King, Kevin Cernekee, Gregory Fong
On Fri, Jul 24, 2026, at 08:30, Karl Mehltretter wrote:
> 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
When we added the 36 bit limit, that was specifically to account
for CONFIG_IO_36 on XSC3 cores, see commit 23bdf86aa06e ("[ARM]
3377/2: add support for intel xsc3 core") and the thread around
https://lore.kernel.org/all/CAK8P3a2MCdUbN0QSb+M3g5_6HjPsaQwtKxFjADMZWomdry4-Ww@mail.gmail.com/
It's probably safe to assume that none of this is used in
practice, as only PXA3xx has this CPU core now that IXP23xx and IOP
are gone, and PXA does not use the high addressing. Similarly, we
never had any platform attempt to use IO_36 on ARMv6 or ARMv7-A.
Can you update the patch to also remove CONFIG_IO_36 and explain
the dependency?
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: set MAX_PHYSMEM_BITS to 32 for !LPAE
2026-07-24 7:23 ` Arnd Bergmann
@ 2026-07-24 7:50 ` Karl Mehltretter
0 siblings, 0 replies; 3+ messages in thread
From: Karl Mehltretter @ 2026-07-24 7:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel, Russell King, Kevin Cernekee, Gregory Fong
On Fri, Jul 24, 2026 at 09:23:45AM +0100, Arnd Bergmann wrote:
> When we added the 36 bit limit, that was specifically to account
> for CONFIG_IO_36 on XSC3 cores, see commit 23bdf86aa06e ("[ARM]
> 3377/2: add support for intel xsc3 core") and the thread around
>
> https://lore.kernel.org/all/CAK8P3a2MCdUbN0QSb+M3g5_6HjPsaQwtKxFjADMZWomdry4-Ww@mail.gmail.com/
>
> It's probably safe to assume that none of this is used in
> practice, as only PXA3xx has this CPU core now that IXP23xx and IOP
> are gone, and PXA does not use the high addressing. Similarly, we
> never had any platform attempt to use IO_36 on ARMv6 or ARMv7-A.
>
> Can you update the patch to also remove CONFIG_IO_36 and explain
> the dependency?
Hi Arnd,
Good catch, I wasn't aware of that history. I'll do that.
Thanks,
Karl
^ permalink raw reply [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.