Messages in this thread Patch in this message | | | From | Jiri Olsa <> | Subject | [PATCH] x86_64: disable identity mappings statically | Date | Fri, 11 Feb 2011 15:00:30 +0100 |
| |
hi,
while browsing the page table setup code, I noticed the x86_64 head code might not need the identity mappings at all. It seems it's ok to switch it off completely from the begining, unless I'm missing something.
wbr, jirka
Signed-off-by: Jiri Olsa <jolsa@redhat.com> --- arch/x86/kernel/head64.c | 10 ---------- arch/x86/kernel/head_64.S | 9 ++++----- 2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 2d2673c..620a9c3 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -27,13 +27,6 @@ #include <asm/trampoline.h> #include <asm/bios_ebda.h> -static void __init zap_identity_mappings(void) -{ - pgd_t *pgd = pgd_offset_k(0UL); - pgd_clear(pgd); - __flush_tlb_all(); -} - /* Don't add a printk in there. printk relies on the PDA which is not initialized yet. */ static void __init clear_bss(void) @@ -74,9 +67,6 @@ void __init x86_64_start_kernel(char * real_mode_data) /* clear bss before set_intr_gate with early_idt_handler */ clear_bss(); - /* Make NULL pointers segfault */ - zap_identity_mappings(); - /* Cleanup the over mapped high alias */ cleanup_highmap(); diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 239046b..c55e6fa 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -341,13 +341,12 @@ ENTRY(name) .data /* - * This default setting generates an ident mapping at address 0x100000 - * and a mapping for the kernel that precisely maps virtual address - * 0xffffffff80000000 to physical address 0x000000. (always using - * 2Mbyte large pages provided by PAE mode) + * This default setting generates a mapping for the kernel that + * precisely maps virtual address 0xffffffff80000000 to physical + * address 0x000000. (always using * 2Mbyte large pages provided + * by PAE mode) */ NEXT_PAGE(init_level4_pgt) - .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE .org init_level4_pgt + L4_PAGE_OFFSET*8, 0 .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE .org init_level4_pgt + L4_START_KERNEL*8, 0 -- 1.7.1
| |