Skip to contentSkip to conversation

x86 early boot ioremap

RFC PATCH New Dave Hansen 1 participant 1 message Feb 13, 2003

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 x86 early boot ioremap

We need to map in some memory areas >8MB just to find out how much memory we have, and where it is. (the e820 table doesn't cut it on this hardware)

This is only intended for remapping while the boot-time pagetables are still in use. It was a pain to get the 2-level pgtable.h functions, so I just undef'd CONFIG_X86_PAE for my file. It looks awfully hackish, but it works well.

Some of my colleagues (Martin) would prefer to steal ptes from some other source (just pick the last N from pg1), then replace them when the remapping is done. I don't really like this approach. I prefer to know exactly where I'm stealing them from, which is where boot_ioremap_area[] comes in.

I would be amenable to making this dependent on some config option set via CONFIG_X86_SUMMIT, to keep from bloating the normal kernel case which doesn't use this code.

Signature · 2 lines
Dave Hansen
[email protected]
arch/i386/mm/Makefile +1 -1
diff -urN --exclude-from=/work/dave/linux/exclude linux-2.5.59-mjb5-clean/arch/i386/mm/Makefile linux-2.5.59-mjb5-pgtablefun/arch/i386/mm/Makefile
@@ -4,7 +4,7 @@
 
 export-objs := pageattr.o
 
-obj-y	:= init.o pgtable.o fault.o ioremap.o extable.o pageattr.o
+obj-y	:= init.o pgtable.o fault.o ioremap.o extable.o pageattr.o boot_ioremap.o
 
 obj-$(CONFIG_DISCONTIGMEM)	+= discontig.o
 obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
arch/i386/mm/boot_ioremap.c +94 -0

94 lines not on this page · raw message

include/asm-i386/page.h +1 -0
diff -urN --exclude-from=/work/dave/linux/exclude linux-2.5.59-mjb5-clean/include/asm-i386/page.h linux-2.5.59-mjb5-pgtablefun/include/asm-i386/page.h
@@ -49,6 +49,7 @@
 typedef struct { unsigned long pte_low; } pte_t;
 typedef struct { unsigned long pmd; } pmd_t;
 typedef struct { unsigned long pgd; } pgd_t;
+#define boot_pte_t pte_t /* or would you rather have a typedef */
 #define pte_val(x)	((x).pte_low)
 #define HPAGE_SHIFT	22
 #endif