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:	Sun, 12 Jul 2009 01:29:29 +0400
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Ingo Molnar <mingo@...e.hu>,
	"Maciej W. Rozycki" <macro@...ux-mips.org>
Cc:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Yinghai Lu <yinghai@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: [RFC -tip] x86,apic - set cpu_has_apic for discrete apic

In case of discrete apic (due to hardware or firmware reason)
cpuid may not retrieve cpu_has_apic bit. So for SMP
compiled kernels instead of long check we may set "fake"
cpu_has_apic bit and check only the bit in further code
flow.

Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
---

Please review carefully.

 arch/x86/kernel/apic/apic.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Index: linux-2.6.git/arch/x86/kernel/apic/apic.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic/apic.c
+++ linux-2.6.git/arch/x86/kernel/apic/apic.c
@@ -1003,6 +1003,20 @@ int __init verify_local_APIC(void)
 	unsigned int reg0, reg1;
 
 	/*
+	 * For discrete APIC case cpu_has_apic bit could not
+	 * be retrieved via cpuid instruction. Same time
+	 * we rely on this bit (mostly for SMP compiled
+	 * kernel) and instead of checking the long condition
+	 * below all the time we do check for plain cpu_has_apic.
+	 *
+	 * At this moment all the checks are passed and we've
+	 * already complained if there was a BIOS bug. This place
+	 * should be safe for such a trick. --cvg
+	 */
+	if (smp_found_config && !cpu_has_apic && !disable_apic)
+		set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
+
+	/*
 	 * The version register is read-only in a real APIC.
 	 */
 	reg0 = apic_read(APIC_LVR);
--
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