[PATCH] Assign PKMAP_BASE dynamically
From: Martin J. Bligh
Date: Mon Nov 22 2004 - 15:55:57 EST
Badari hit a problem when configuring PAE off (ie CONFIG_4G) where
the pkmap area could end up overlapping the fixmap area. For some
reason, PKMAP_BASE was defined statically, which seems rather pointless,
and asking for trouble. Patch below definines it dynamically, under the
fixmap area. The ordering of the VMALLOC_RESERVE space is:
FIXADDR_TOP
fixed_addresses
FIXADDR_START
temp fixed addresses
FIXADDR_BOOT_START
Persistent kmap area
PKMAP_BASE
VMALLOC_END
Vmalloc area
VMALLOC_START
high_memory
Could you give this a spin in -mm? I've tested it on the afflicted box,
and confirmed it fixes the problem.
M.
diff -purN -X /home/mbligh/.diff.exclude /home/linux/views/linux-2.6.10-rc1-mm2/include/asm-i386/fixmap.h 2.6.10-rc1-mm2-badari/include/asm-i386/fixmap.h
--- /home/linux/views/linux-2.6.10-rc1-mm2/include/asm-i386/fixmap.h 2004-10-18 15:51:09.000000000 -0700
+++ 2.6.10-rc1-mm2-badari/include/asm-i386/fixmap.h 2004-11-22 10:24:27.000000000 -0800
@@ -109,7 +109,9 @@ extern void __set_fixmap (enum fixed_add
#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
#define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
-#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
+#define __FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
+#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
+#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
diff -purN -X /home/mbligh/.diff.exclude /home/linux/views/linux-2.6.10-rc1-mm2/include/asm-i386/highmem.h 2.6.10-rc1-mm2-badari/include/asm-i386/highmem.h
--- /home/linux/views/linux-2.6.10-rc1-mm2/include/asm-i386/highmem.h 2004-10-29 01:52:51.000000000 -0700
+++ 2.6.10-rc1-mm2-badari/include/asm-i386/highmem.h 2004-11-22 10:28:17.000000000 -0800
@@ -40,16 +40,27 @@ extern void kmap_init(void);
* easily, subsequent pte tables have to be allocated in one physical
* chunk of RAM.
*/
-#if NR_CPUS <= 32
-#define PKMAP_BASE (0xff800000UL)
-#else
-#define PKMAP_BASE (0xff600000UL)
-#endif
#ifdef CONFIG_X86_PAE
#define LAST_PKMAP 512
#else
#define LAST_PKMAP 1024
#endif
+/*
+ * Ordering is:
+ *
+ * FIXADDR_TOP
+ * fixed_addresses
+ * FIXADDR_START
+ * temp fixed addresses
+ * FIXADDR_BOOT_START
+ * Persistent kmap area
+ * PKMAP_BASE
+ * VMALLOC_END
+ * Vmalloc area
+ * VMALLOC_START
+ * high_memory
+ */
+#define PKMAP_BASE ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK )
#define LAST_PKMAP_MASK (LAST_PKMAP-1)
#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/