lkml.org 
[lkml]   [2012]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 05/27] x86, 64bit: clear ident mapping when kernel is above 512G
Date
After following patch:
x86, 64bit: Set extra ident mapping for whole kernel range

We have extra ident mapping for kernel that is loaded above 1G.

So need to clear extra pgd entry when kernel is loaded above 512g.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/kernel/head64.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 037df57..3ef9ce6 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -29,7 +29,17 @@
static void __init zap_identity_mappings(void)
{
pgd_t *pgd = pgd_offset_k(0UL);
+ unsigned long pa_text = __pa_symbol(_text);
+ unsigned long pa_end = __pa_symbol(_end);
+
pgd_clear(pgd);
+
+ /* When kernel is loaded above 512G */
+ if (pa_text >= PGDIR_SIZE)
+ pgd_clear(pgd + pgd_index(pa_text));
+ if (pa_end - 1 >= PGDIR_SIZE)
+ pgd_clear(pgd + pgd_index(pa_end - 1));
+
__flush_tlb_all();
}

--
1.7.10.4


\
 
 \ /
  Last update: 2012-12-13 23:41    [W:0.189 / U:4.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site