Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 11:23:37 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        pho@FreeBSD.org, freebsd-current@FreeBSD.org
Subject:   Re: panic: double fault with 11.0-CURRENT r258504
Message-ID:  <20131128092337.GL59496@kib.kiev.ua>
In-Reply-To: <201311280856.rAS8ubLR044563@gw.catspoiler.org>
References:  <20131128075610.GJ59496@kib.kiev.ua> <201311280856.rAS8ubLR044563@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--ClNGE9wjI6a/CVmZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Nov 28, 2013 at 12:56:37AM -0800, Don Lewis wrote:
> I haven't figured out how to find the currently installed BIOS version.
> The motherboard is Abit, which is no more, but I found an archive of all
> of their downloads.  I'll also check into updates from the Linux world.
I reviewed the 0xF family revision guide, and stumbled upon errata 122,
"TLB Flush Filter May Cause Coherency Problem in Multicore Systems".
You could try the patch at the end of message.

> This machine gets updated every month or so and I've never had stability
> problems with it until just recently.  It's definitely been using clang
> for quite a while without any problems other than the ports mess.
Is it possible to bisect ?

diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 34a362d..87e3f69 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -88,6 +88,11 @@ static void
 init_amd(void)
 {
=20
+	if (CPUID_TO_FAMILY(cpu_id) =3D=3D 0x9) {
+		if ((cpu_feature2 & CPUID2_HV) =3D=3D 0)
+			wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) | (1 << 6));
+	}
+
 	/*
 	 * Work around Erratum 721 for Family 10h and 12h processors.
 	 * These processors may incorrectly update the stack pointer
diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c
index 71c57b2..662ea8e 100644
--- a/sys/i386/i386/initcpu.c
+++ b/sys/i386/i386/initcpu.c
@@ -651,6 +651,32 @@ init_transmeta(void)
 }
 #endif
=20
+static void
+init_amd(void)
+{
+
+#ifdef CPU_ATHLON_SSE_HACK
+	/*
+	 * Sometimes the BIOS doesn't enable SSE instructions.
+	 * According to AMD document 20734, the mobile Duron, the
+	 * (mobile) Athlon 4 and the Athlon MP support SSE. These
+	 * correspond to cpu_id 0x66X or 0x67X.
+	 */
+	if ((cpu_feature & CPUID_XMM) =3D=3D 0 && ((cpu_id & ~0xf) =3D=3D 0x660 ||
+	    (cpu_id & ~0xf) =3D=3D 0x670 || (cpu_id & ~0xf) =3D=3D 0x680)) {
+		u_int regs[4];
+
+		wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) & ~0x08000);
+		do_cpuid(1, regs);
+		cpu_feature =3D regs[3];
+	}
+#endif
+	if (CPUID_TO_FAMILY(cpu_id) =3D=3D 0x9) {
+		if ((cpu_feature2 & CPUID2_HV) =3D=3D 0)
+			wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) | (1 << 6));
+	}
+}
+
 /*
  * Initialize CR4 (Control register 4) to enable SSE instructions.
  */
@@ -725,26 +751,9 @@ initializecpu(void)
 				break;
 			}
 			break;
-#ifdef CPU_ATHLON_SSE_HACK
 		case CPU_VENDOR_AMD:
-			/*
-			 * Sometimes the BIOS doesn't enable SSE instructions.
-			 * According to AMD document 20734, the mobile
-			 * Duron, the (mobile) Athlon 4 and the Athlon MP
-			 * support SSE. These correspond to cpu_id 0x66X
-			 * or 0x67X.
-			 */
-			if ((cpu_feature & CPUID_XMM) =3D=3D 0 &&
-			    ((cpu_id & ~0xf) =3D=3D 0x660 ||
-			     (cpu_id & ~0xf) =3D=3D 0x670 ||
-			     (cpu_id & ~0xf) =3D=3D 0x680)) {
-				u_int regs[4];
-				wrmsr(MSR_HWCR, rdmsr(MSR_HWCR) & ~0x08000);
-				do_cpuid(1, regs);
-				cpu_feature =3D regs[3];
-			}
+			init_amd();
 			break;
-#endif
 		case CPU_VENDOR_CENTAUR:
 			init_via();
 			break;

--ClNGE9wjI6a/CVmZ
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJSlwuZAAoJEJDCuSvBvK1BHF4P/AhxoGwDlkQZDUhP7TbL4SjQ
ZbZdz64oCWCBADG38WfuIvGxpz59UMcFkYQbCGjFlnq/NjFtwh67q7vHhhUfO5Xu
PBeTXytfyNbsN+b37eSFTnFtr8ENYj5qrmtX3pMCiil/zYB3nfkhw3RYE6k4rGPo
vx2rVAGIpvtkSL5CxV9A2S+eJe4N3Kr/eTwlYBq4tHVhtvajU00ncXFoRFfsDsiu
WKFhq1g759kRuKGshr7vP9cidHN9ycBZU1PruoZU+Bg5sF4q2EpYhL5iyETAGqhn
LTJHprIYiFk2yx2afNyV8mrteyERnBnyFoiYjvEESC9GIGMi7Agtc3CvY3TMMSRN
UDyt/AY9IZeXl6FMP3jN0qH+zvMSjupflVuwAK98QCpzr6oO/ONk1PDpmXhURhrY
To+0Efzo8LQr52Q94w2jS2ZlyC82l7fDtSbPvh+b1AR4W+G6MQ0vai/H/PO8nF/f
9bWwYNdBCBkc9ZCBSi5XRF09YZVz8GMk0SgdeNfYCpy1Rbl+qUlDckTo7yzbmZYe
4drSAqbTf9aIXHB+Hbr4gvjK/Fi4noStLSlS/heFrzInS3VWK2f8F/i7UTH5XEL1
mmtqwRaa4mg55lbykZ+fDfCECEOT5Htl0LgHfwe52JU3UZHVRrGbGYFCC/8z3gqq
fN943y5C1+RSdwvn017Y
=dLwf
-----END PGP SIGNATURE-----

--ClNGE9wjI6a/CVmZ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131128092337.GL59496>