From owner-freebsd-current@FreeBSD.ORG Thu Nov 28 09:23:43 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 994C9888; Thu, 28 Nov 2013 09:23:43 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE981039; Thu, 28 Nov 2013 09:23:42 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rAS9NbOL043854; Thu, 28 Nov 2013 11:23:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rAS9NbOL043854 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rAS9Nb9P043853; Thu, 28 Nov 2013 11:23:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Nov 2013 11:23:37 +0200 From: Konstantin Belousov To: Don Lewis Subject: Re: panic: double fault with 11.0-CURRENT r258504 Message-ID: <20131128092337.GL59496@kib.kiev.ua> References: <20131128075610.GJ59496@kib.kiev.ua> <201311280856.rAS8ubLR044563@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ClNGE9wjI6a/CVmZ" Content-Disposition: inline In-Reply-To: <201311280856.rAS8ubLR044563@gw.catspoiler.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: pho@FreeBSD.org, freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2013 09:23:43 -0000 --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--