Date: Fri, 26 Jun 2009 21:22:44 +0400 From: Stanislav Sedov <stas@FreeBSD.org> To: Ian J Hart <ianjhart@ntlworld.com> Cc: freebsd-current@freebsd.org Subject: Re: AMD errata 169 Message-ID: <20090626212244.783465ae.stas@FreeBSD.org> In-Reply-To: <20090626123727.18824c9jkz72dw8w@10.248.192.16> References: <20090626123727.18824c9jkz72dw8w@10.248.192.16>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <ianjhart@ntlworld.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090626212244.783465ae.stas>