]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: fixmap: Allow 256K early_ioremap() at any offset
authorYu Peng <pengyu@kylinos.cn>
Wed, 8 Jul 2026 02:35:14 +0000 (10:35 +0800)
committerWill Deacon <will@kernel.org>
Thu, 16 Jul 2026 13:50:30 +0000 (14:50 +0100)
NR_FIX_BTMAPS is the per-slot page limit for early_ioremap(). Since
__early_ioremap() maps the page-aligned physical range, a 256K request
can require one extra page when the physical address is not page-aligned.

Reserve one extra page per slot so the 256K mapping budget is usable
regardless of the initial page offset.

Link: https://lore.kernel.org/r/08fd96fa-ee3a-4904-bd11-bb08bd90436f@kylinos.cn
Signed-off-by: Yu Peng <pengyu@kylinos.cn>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/fixmap.h

index 65555284446e731a55f460af5e325cbbb1afa3a5..7075a3bd2c61679e8728f7afacf41398f0c9ab4d 100644 (file)
@@ -78,8 +78,12 @@ enum fixed_addresses {
        /*
         * Temporary boot-time mappings, used by early_ioremap(),
         * before ioremap() is functional.
+        *
+        * Reserve one extra page so a 256K mapping may start at any
+        * offset within a page. early_ioremap() maps the page-aligned
+        * physical range, so the initial offset can consume an extra page.
         */
-#define NR_FIX_BTMAPS          (SZ_256K / PAGE_SIZE)
+#define NR_FIX_BTMAPS          ((SZ_256K / PAGE_SIZE) + 1)
 #define FIX_BTMAPS_SLOTS       7
 #define TOTAL_FIX_BTMAPS       (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)