From: Jiri Olsa <jolsa@redhat.com>
To: ebiederm@xmission.com, tglx@linutronix.de, mingo@redhat.com
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Jiri Olsa <jolsa@redhat.com>
Subject: [PATCH] x86_64: disable identity mappings statically
Date: Fri, 11 Feb 2011 15:00:30 +0100 [thread overview]
Message-ID: <1297432830-3912-1-git-send-email-jolsa@redhat.com> (raw)
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
next reply other threads:[~2011-02-11 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-11 14:00 Jiri Olsa [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1297432830-3912-1-git-send-email-jolsa@redhat.com \
--to=jolsa@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®