All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64: disable identity mappings statically
@ 2011-02-11 14:00 Jiri Olsa
  2011-02-11 16:46 ` Eric W. Biederman
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2011-02-11 14:00 UTC (permalink / raw)
  To: ebiederm, tglx, mingo; +Cc: x86, linux-kernel, Jiri Olsa

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-02-12  8:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-11 14:00 [PATCH] x86_64: disable identity mappings statically Jiri Olsa
2011-02-11 16:46 ` Eric W. Biederman
2011-02-11 17:07   ` Jiri Olsa
2011-02-11 17:35     ` Cyrill Gorcunov
2011-02-11 17:59     ` Brian Gerst
2011-02-11 19:13       ` Jiri Olsa
2011-02-11 20:19         ` Brian Gerst
2011-02-11 20:40           ` Jiri Olsa
2011-02-11 21:59             ` Brian Gerst
2011-02-12  8:57               ` Jiri Olsa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.