diff mbox series

[v2,3/6] ARM: Make the number of fix bitmap depend on the page size

Message ID 20200611134914.765827-4-gregory.clement@bootlin.com (mailing list archive)
State New, archived
Headers show
Series ARM: Add support for large kernel page (from 8K to 64K) | expand

Commit Message

Gregory CLEMENT June 11, 2020, 1:49 p.m. UTC
Currently the number of fixmap used is fixed. However, if the page
size is no more 4K but a larger one, then, the space occupied by
fixmap is too big.

The total fixmap size being fixed, the number of fixmap should depend
of the page size as it is done for arm64.

Instead of always using 32 fixmap, we try to always having the same
size: 128KB, which for 4KB page matches these 32 pages.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
 arch/arm/include/asm/fixmap.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm/include/asm/fixmap.h b/arch/arm/include/asm/fixmap.h
index 472c93db5dac..d4b82af5a96d 100644
--- a/arch/arm/include/asm/fixmap.h
+++ b/arch/arm/include/asm/fixmap.h
@@ -6,6 +6,7 @@ 
 #define FIXADDR_END		0xfff00000UL
 #define FIXADDR_TOP		(FIXADDR_END - PAGE_SIZE)
 
+#include <linux/sizes.h>
 #include <asm/kmap_types.h>
 #include <asm/pgtable.h>
 
@@ -27,7 +28,7 @@  enum fixed_addresses {
 	 * not to clash since early_ioremap() is only available before
 	 * paging_init(), and kmap() only after.
 	 */
-#define NR_FIX_BTMAPS		32
+#define NR_FIX_BTMAPS		(SZ_128K / PAGE_SIZE)
 #define FIX_BTMAPS_SLOTS	7
 #define TOTAL_FIX_BTMAPS	(NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)