lkml.org 
[lkml]   [2014]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] x86: Quark: Comment setup_arch for TLB/PGE bugfix
Date
Quark X1000 requires CR3 to be rewritten to flush TLB entries
irrespective of the PGE bits in CR4 or PTE.PGE

Add a comment to setup_arch to indicate that the code

load_cr3(swapper_pg_dir);
__flush_tlb_all();

Will already have flushed the TLB @ the CR3 reload allowing us
to skip over a potential if/else for Quark.

This comment clearly states the bug, the behaviour we rely on
and the reason why we only do it this way - one time.

Later on cpu_has_pge() will be false due to a fixup in
intel_init_early() and __flush_tlb_all() will work as expected
from that point onwards

Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
---
arch/x86/kernel/setup.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 41ead8d..98b6660 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -878,6 +878,18 @@ void __init setup_arch(char **cmdline_p)
initial_page_table + KERNEL_PGD_BOUNDARY,
KERNEL_PGD_PTRS);

+ /*
+ * Locate the page directory and flush the TLB.
+ *
+ * On Quark X1000 CPUs we still have the PGE bit incorrectly set
+ * due to a processor erratum, so __flush_tlb_all() is not yet
+ * doing what it says. Fortunately we have a cr3 load here,
+ * which is what is needed on this processor to flush TLBs, so
+ * there's no need to add a Quark X1000 quirk here.
+ *
+ * early_init_intel will unset the X86_FEATURE_PGE flag later
+ * and __flush_tlb_all() will flush via cr3
+ */
load_cr3(swapper_pg_dir);
__flush_tlb_all();
#else
--
1.9.1


\
 
 \ /
  Last update: 2014-09-30 05:41    [W:0.070 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site