Skip to contentSkip to conversation

i386 bootmem restrictions

PATCH New Andy Whitcroft 1 participant 1 message Aug 26, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386 bootmem restrictions

The bootmem allocator is initialised before the kernel virtual address space has been fully established. As a result, any allocations which are made before paging_init() has completed may point to invalid kernel addresses. This patch notes this limitation and indicates where the allocator is fully available.

Revision: $Rev: 572 $

diffstat 100-ia32_bootmem

---
 setup.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)
arch/i386/kernel/setup.c +10 -1
diff -X /home/apw/brief/lib/vdiff.excl -rupN reference/arch/i386/kernel/setup.c current/arch/i386/kernel/setup.c
@@ -1350,7 +1350,12 @@ void __init setup_arch(char **cmdline_p)
 
 	/*
 	 * NOTE: before this point _nobody_ is allowed to allocate
-	 * any memory using the bootmem allocator.
+	 * any memory using the bootmem allocator.  Although the
+	 * alloctor is now initialised only the first 8Mb of the kernel
+	 * virtual address space has been mapped.  All allocations before
+	 * paging_init() has completed must use the alloc_bootmem_low_pages()
+	 * variant (which allocates DMA'able memory) and care must be taken
+	 * not to exceed the 8Mb limit.
 	 */
 
 #ifdef CONFIG_SMP
@@ -1358,6 +1363,10 @@ void __init setup_arch(char **cmdline_p)
 #endif
 	paging_init();
 
+	/*
+	 * NOTE: at this point the bootmem allocator is fully available.
+	 */
+
 #ifdef CONFIG_EARLY_PRINTK
 	{
 		char *s = strstr(*cmdline_p, "earlyprintk=");