]> git.hungrycats.org Git - linux/commitdiff
[PATCH] i386 bootmem restrictions
authorAndy Whitcroft <apw@shadowen.org>
Tue, 31 Aug 2004 03:37:03 +0000 (20:37 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 31 Aug 2004 03:37:03 +0000 (20:37 -0700)
(Comment changes only)

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.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/setup.c

index 534a3c20e8d50d326bacc4e311a7c5df5949e680..ada5e8bcedbaf1f6f7886f5d5deaadb2a6221b7c 100644 (file)
@@ -1355,7 +1355,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
@@ -1363,6 +1368,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=");