lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 26 Sep 2014 18:55:18 +0100
From:	Bryan O'Donoghue <pure.logic@...us-software.ie>
To:	hpa@...or.com, mingo@...hat.com, tglx@...utronix.de,
	davej@...hat.com, hmh@....eng.br, boon.leong.ong@...el.com
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Bryan O'Donoghue <pure.logic@...us-software.ie>
Subject: [PATCH v2] x86: Quark: Add if/else to setup_arch for Quark TLB bug

Quark X1000 incorrectly advertises PGE. In later 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

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

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 41ead8d..980c3c3 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -879,7 +879,21 @@ 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 ithe 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_vendor == X86_VENDOR_INTEL &&
+	    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
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ