From owner-freebsd-current@FreeBSD.ORG Fri Jun 26 17:22:47 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F0841065672 for ; Fri, 26 Jun 2009 17:22:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8F98FC14 for ; Fri, 26 Jun 2009 17:22:46 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id D99518FC2E; Fri, 26 Jun 2009 21:22:44 +0400 (MSD) Date: Fri, 26 Jun 2009 21:22:44 +0400 From: Stanislav Sedov To: Ian J Hart Message-Id: <20090626212244.783465ae.stas@FreeBSD.org> In-Reply-To: <20090626123727.18824c9jkz72dw8w@10.248.192.16> References: <20090626123727.18824c9jkz72dw8w@10.248.192.16> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__26_Jun_2009_21_22_44_+0400_Ll=of+iMoR0vZ48u" Cc: freebsd-current@freebsd.org Subject: Re: AMD errata 169 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 26 Jun 2009 17:22:47 -0000 --Signature=_Fri__26_Jun_2009_21_22_44_+0400_Ll=of+iMoR0vZ48u Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, 26 Jun 2009 12:37:27 +0100 Ian J Hart mentioned: > I know I asked this before but I figure the long post may have put =20 > some people off. >=20 > #169 > http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/2= 5759.pdf >=20 > I'd like to eliminate this as a cause of my problem >=20 > It appears I can read the value. >=20 > #kldload cpuctl > #cpucontrol -m 0xc001001f /dev/cpuctl0 > MSR 0xc001001f: 0x00400000 0x00100008 >=20 > #cpucontrol -m 0xc001001f=3D0x0040000000100008 /dev/cpuctl0 >=20 > Causes an nfe0 watchdog timeout and a powerdown failed, so that's =20 > clearly a dumb thing to do. >=20 > Would I be better off asking somewhere else? It looks like it is my fault in fact. Due to the bug in cpuctl code the value written to MSR registers always was zero. Can you, please, try with the following patch? Thanks! Index: sys/dev/cpuctl/cpuctl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/dev/cpuctl/cpuctl.c (revision 195052) +++ sys/dev/cpuctl/cpuctl.c (working copy) @@ -222,14 +222,17 @@ * Explicitly clear cpuid data to avoid returning stale * info */ - data->data =3D 0; DPRINTF("[cpuctl,%d]: operating on MSR %#0x for %d cpu\n", __LINE__, data->msr, cpu); oldcpu =3D td->td_oncpu; is_bound =3D cpu_sched_is_bound(td); set_cpu(cpu, td); - ret =3D cmd =3D=3D CPUCTL_RDMSR ? rdmsr_safe(data->msr, &data->data) : - wrmsr_safe(data->msr, data->data); + if (cmd =3D=3D CPUCTL_RDMSR) { + data->data =3D 0; + ret =3D rdmsr_safe(data->msr, &data->data); + } else { + ret =3D wrmsr_safe(data->msr, data->data); + } restore_cpu(oldcpu, is_bound, td); return (ret); } @@ -368,7 +371,7 @@ /* * Perform update. */ - wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)args->data); + wrmsr_safe(MSR_K8_UCODE_UPDATE, (uintptr_t)ptr); =20 /* * Serialize instruction flow. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Fri__26_Jun_2009_21_22_44_+0400_Ll=of+iMoR0vZ48u Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKRQPkAAoJEKN82nOYvCd0NrwP/RF0OJ0qOSovgPnGIUldK4WX 6+hNZ97/1kfYEllZmvCCy+of8jYFFAcYpbC9E+KLBJioD9KqqG0M6noCAGFUpYL9 80y8hC85unjqr2LIkpSDbXME1+fDKh2hiT2racC6m4LgWoVG4Gz2JQO1iZlbvsp5 eBJOoJ9Pq1uYcHgTdh00nLPV5vTPKFB+Dv7YO8+/kkYvcQkjKwzCB2PJnX516p8A blz8tHj1tkM2oFvaJ42x+NmCeFhXUgwsPiz/NXirFp+3ePce4HngAqQXJU6XVSoI bYlNxOFOGFpesO2U19s8kL37KteB0IlRrOAFJiYtklSbUcXTmKPzluLvhsNwqXkW M/vfXSabpu46Qc2d2mHSaJqmR7l81y805vvw09T9JHfWcLC5Rde5aMrpTOt8LbK4 I+wFVnYZbaLcxdEcLa5i/g3nKggWEYQHDRm2Sbg81yd25oj00m5RgQFowoU33Oyb xNQC3e3HZA1aRf1jMxKpblQKElLKvxp6u5lqy/1LwhIedE6j4rmYyfmvemQpxwAj l33+gv5hi+0SmycMLycEHg7d5870lVf/h9CAB5qi7xLNdIKlTLHJ3Yl/Oets5btm FYxkrJphapB3H2AqyxCaX47bHpYnaU9HMlEcKG94PNH3c5GbBTgtXHPWChnp0f1N KvBzYhqO8kS+U6BZaWo/ =qHQ7 -----END PGP SIGNATURE----- --Signature=_Fri__26_Jun_2009_21_22_44_+0400_Ll=of+iMoR0vZ48u--