x86: Quark: Add if/else to setup_arch for Quark TLB bug
PATCH 1/1 x86: Quark: Add if/else to setup_arch for Quark TLB bug
Quark X1000 incorrectly advertises PGE. In later the stages of boot specifically in early_init_intel we setup_clear_cpu_cap for PGE. At this point in time cpu_has_pge() will still be true.
Use the boot_cpu_data to decide if __flush_tlb_all() or __flush_tlb() should be called subsequent to loading CR3
--- arch/x86/kernel/setup.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
arch/x86/kernel/setup.c +14 -1
@@ -879,7 +879,20 @@ void __init setup_arch(char **cmdline_p) KERNEL_PGD_PTRS);load_cr3 (swapper_pg_dir); -__flush_tlb_all (); + +/* +* Flush the TLB after loading CR3 +* +* Quark X1000 wrongly advertises PGE. Use boot_cpu_data to +* to make sure the TLB is flushed correctly in the early +* stage of setup_arch() for Quark X1000. +* X86_FEATURE_PGE flag is only setup later stage at +* early_cpu_init(); +*/ +if (boot_cpu_data.x86 ==5 && boot_cpu_data.x86_model ==9 ) +__flush_tlb (); +else +__flush_tlb_all ();#else printk (KERN_INFO "Command line: %s\n" , boot_command_line);#endif
Signature · 1 line
1.9.1
Quoted 7 lines · Bryan O'Donoghue
Quark X1000 incorrectly advertises PGE. In later the stages of boot specifically in
early_init_intelwesetup_clear_cpu_capfor PGE. At this point in timecpu_has_pge()will still be true.Use the
boot_cpu_datato decide if__flush_tlb_all()or__flush_tlb()should be called subsequent to loading CR3
arch/x86/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 893
Quoted 10 lines
arch/x86/kernel/setup.c +10
-0+* Flush the TLB after loading CR3 +* +* Quark X1000 wrongly advertises PGE. Use boot_cpu_data to +* to make sure the TLB is flushed correctly in the early +* stage of setup_arch() for Quark X1000. +* X86_FEATURE_PGE flag is only setup later stage at +* early_cpu_init(); +*/ +if (boot_cpu_data.x86 ==5 && boot_cpu_data.x86_model ==9 ) +__flush_tlb ();
This also needs a check for the cpu vendor, or this will apply the workaround on for eg, AMD K6-III's.
Dave
Quoted 5 lines · Dave Jones
arch/x86/kernel/setup.c void __init setup_arch(char **cmdline_p) · line 893
Quoted 2 lines
arch/x86/kernel/setup.c +2
-0+if (boot_cpu_data.x86 ==5 && boot_cpu_data.x86_model ==9 ) +__flush_tlb ();This also needs a check for the cpu vendor, or this will apply the workaround on for eg, AMD K6-III's.
Ah OK.
Will update.
--
BOD