Eric W. Biederman
2007-Apr-30 08:48 UTC
[PATCH 0/12] Early USB debug port and i386 boot cleanups
Modern hardware relies primarily on memory mapped I/O which is typically at addresses that are not mapped by the kernels initial page tables, which makes using them currently unusable for early debugging print support. So this patch set digs in and fixes the early page tables on both arch/i386 and arch/x86_64 so that set_fixmap works with our initial boot page tables. All that is needed is that we allocate preallocate the pte page that the fixmap entries live on. On arch/i386 I accomplish this by ensuring the boot time page tables are in the native mode. Doing this provides an alternative and slightly more capable fix to Jeremy's problem of not having the initial memory mapping covering enough pages to identity map all of low memory. Because we are now updating the page table we are running on we add the mappings we need for the initial page table as we build the initial page table. Since I was in there I kept cleaning up arch/i386/head.S. In particular I have gotten as far as removing the early cpuid, and have added a head32.S. Eric
Eric W. Biederman
2007-Apr-30 08:50 UTC
[PATCH 01/12] x86_64: Allow fixmaps to be used with the initial page table.
This patch preallocates the intermediate page table entries so that all that is needed to setup a fixmap is to fill in the appropriate pte. By doing this modern hardware that uses memory mapped access can be talked to early in boot through a fixmap. Allowing USB debugging and the like. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> --- arch/x86_64/kernel/head.S | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 1fab487..1b704c4 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S @@ -74,6 +74,9 @@ startup_64: addq %rbp, level3_ident_pgt + 0(%rip) addq %rbp, level3_kernel_pgt + (510*8)(%rip) + addq %rbp, level3_kernel_pgt + (511*8)(%rip) + + addq %rbp, level2_fixmap_pgt + (506*8)(%rip) /* Add an Identity mapping if I am above 1G */ leaq _text(%rip), %rdi @@ -314,7 +317,16 @@ NEXT_PAGE(level3_kernel_pgt) .fill 510,8,0 /* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */ .quad level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE - .fill 1,8,0 + .quad level2_fixmap_pgt - __START_KERNEL_map + _KERNPG_TABLE + _PAGE_USER + +NEXT_PAGE(level2_fixmap_pgt) + .fill 506,8,0 + .quad level1_fixmap_pgt - __START_KERNEL_map + _KERNPG_TABLE + _PAGE_USER + /* 8MB reserved for vsyscalls + a 2MB hole = 4 + 1 entries */ + .fill 5,8,0 + +NEXT_PAGE(level1_fixmap_pgt) + .fill 512,8,0 NEXT_PAGE(level2_ident_pgt) /* Since I easily can, map the first 1G. -- 1.5.1.1.181.g2de0
Seemingly Similar Threads
- [PATCH 0/12] Early USB debug port and i386 boot cleanups
- [PATCH v2 00/27] x86: PIE support and option to extend KASLR randomization
- [PATCH v2 00/27] x86: PIE support and option to extend KASLR randomization
- [PATCH] Btrfs: fix free space cache when there are pinned extents and clusters
- [PATCH v3 00/27] x86: PIE support and option to extend KASLR randomization