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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-780eef9492b16a1543a3b2ae9f9526a735fc9856@git.kernel.org>
Date:	Tue, 3 Mar 2009 11:09:27 GMT
From:	Tim Blechmann <tim@...ngt.org>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	robert.richter@....com, stable@...nel.org, tglx@...utronix.de,
	tim@...ngt.org, mingo@...e.hu
Subject: [tip:x86/urgent] x86: oprofile: don't set counter width from cpuid on Core2

Commit-ID:  780eef9492b16a1543a3b2ae9f9526a735fc9856
Gitweb:     http://git.kernel.org/tip/780eef9492b16a1543a3b2ae9f9526a735fc9856
Author:     "Tim Blechmann" <tim@...ngt.org>
AuthorDate: Thu, 19 Feb 2009 17:34:03 +0100
Commit:     Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 3 Mar 2009 12:04:22 +0100

x86: oprofile: don't set counter width from cpuid on Core2

Impact: fix stuck NMIs and non-working oprofile on certain CPUs

Resetting the counter width of the performance counters on Intel's
Core2 CPUs, breaks the delivery of NMIs, when running in x86_64 mode.

This should fix bug #12395:

  http://bugzilla.kernel.org/show_bug.cgi?id=12395

Signed-off-by: Tim Blechmann <tim@...ngt.org>
Signed-off-by: Robert Richter <robert.richter@....com>
LKML-Reference: <20090303100412.GC10085@...a.amd.com>
Cc: <stable@...nel.org>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 arch/x86/oprofile/op_model_ppro.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index e9f80c7..10131fb 100644
--- a/arch/x86/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
 	if (cpu_has_arch_perfmon) {
 		union cpuid10_eax eax;
 		eax.full = cpuid_eax(0xa);
-		if (counter_width < eax.split.bit_width)
-			counter_width = eax.split.bit_width;
+
+		/*
+		 * For Core2 (family 6, model 15), don't reset the
+		 * counter width:
+		 */
+		if (!(eax.split.version_id == 0 &&
+			current_cpu_data.x86 == 6 &&
+				current_cpu_data.x86_model == 15)) {
+
+			if (counter_width < eax.split.bit_width)
+				counter_width = eax.split.bit_width;
+		}
 	}
 
 	/* clear all counters */
--
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