Re: Ryzen public erratas

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Ryzen public erratas

Konstantin Belousov
On Wed, Jun 13, 2018 at 12:06:42PM +0100, Johannes Lundberg wrote:

>
> Konstantin Belousov writes:
>
> > Today I noted that AMD published the public errata document for Ryzens,
> > https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> >
> > Some of the issues listed there looks quite relevant to the potential
> > hangs that some people still experience with the machines.  I wrote
> > a script which should apply the recommended workarounds to the erratas
> > that I find interesting.
> >
> > To run it, kldload cpuctl, then apply the latest firmware update to your
> > CPU, then run the following shell script.  Comments indicate the errata
> > number for the workarounds.
> >
> > Please report the results.  If the script helps, I will code the kernel
> > change to apply the workarounds.
> >
> > #!/bin/sh
> >
> > # Enable workarounds for erratas listed in
> > # https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> >
> > # 1057, 1109
> > sysctl machdep.idle_mwait=0
> > sysctl machdep.idle=hlt
> >
> > for x in /dev/cpuctl*; do
> > # 1021
> > cpucontrol -m '0xc0011029|=0x2000' $x
> > # 1033
> > cpucontrol -m '0xc0011020|=0x10' $x
> > # 1049
> > cpucontrol -m '0xc0011028|=0x10' $x
> > # 1095
> > cpucontrol -m '0xc0011020|=0x200000000000000' $x
> > done
> >
>
> Hi
>
> Thanks for the fix! I'm trying it now on my Ryzen 3 2200G which does
> experience some random occasional resets.
>
> About updating to latest firmware, is this something that's done from BIOS or
> from FreeBSD? If the latter, how?
From FreeBSD, install sysutils/devcpu-data then do
        service microcode_update start
and of course, you must flash latest BIOS.

The microcode_update must be applied before running this script.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-amd64
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Ryzen public erratas

Gary Jennejohn-6
On Wed, 13 Jun 2018 14:46:25 +0300
Konstantin Belousov <[hidden email]> wrote:

> On Wed, Jun 13, 2018 at 12:06:42PM +0100, Johannes Lundberg wrote:
> >
> > Konstantin Belousov writes:
> >  
> > > Today I noted that AMD published the public errata document for Ryzens,
> > > https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> > >
> > > Some of the issues listed there looks quite relevant to the potential
> > > hangs that some people still experience with the machines.  I wrote
> > > a script which should apply the recommended workarounds to the erratas
> > > that I find interesting.
> > >
> > > To run it, kldload cpuctl, then apply the latest firmware update to your
> > > CPU, then run the following shell script.  Comments indicate the errata
> > > number for the workarounds.
> > >
> > > Please report the results.  If the script helps, I will code the kernel
> > > change to apply the workarounds.
> > >
> > > #!/bin/sh
> > >
> > > # Enable workarounds for erratas listed in
> > > # https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> > >
> > > # 1057, 1109
> > > sysctl machdep.idle_mwait=0
> > > sysctl machdep.idle=hlt
> > >
> > > for x in /dev/cpuctl*; do
> > > # 1021
> > > cpucontrol -m '0xc0011029|=0x2000' $x
> > > # 1033
> > > cpucontrol -m '0xc0011020|=0x10' $x
> > > # 1049
> > > cpucontrol -m '0xc0011028|=0x10' $x
> > > # 1095
> > > cpucontrol -m '0xc0011020|=0x200000000000000' $x
> > > done
> > >  
> >
> > Hi
> >
> > Thanks for the fix! I'm trying it now on my Ryzen 3 2200G which does
> > experience some random occasional resets.
> >
> > About updating to latest firmware, is this something that's done from BIOS or
> > from FreeBSD? If the latter, how?  
> From FreeBSD, install sysutils/devcpu-data then do
> service microcode_update start
> and of course, you must flash latest BIOS.
>
> The microcode_update must be applied before running this script.
>

I added before and after outputs to my version of the script and
saw that my BIOS is setting all the relevant bits at start up.

So, a BIOS update might help.

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-amd64
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Ryzen public erratas

Eitan Adler-4
In reply to this post by Konstantin Belousov
On 13 June 2018 at 04:16, Eitan Adler <[hidden email]> wrote:

> On 13 June 2018 at 03:35, Konstantin Belousov <[hidden email]> wrote:
>> Today I noted that AMD published the public errata document for Ryzens,
>> https://developer.amd.com/wp-content/resources/55449_1.12.pdf
>>
>> Some of the issues listed there looks quite relevant to the potential
>> hangs that some people still experience with the machines.  I wrote
>> a script which should apply the recommended workarounds to the erratas
>> that I find interesting.
>>
>> To run it, kldload cpuctl, then apply the latest firmware update to your
>> CPU, then run the following shell script.  Comments indicate the errata
>> number for the workarounds.
>>
>> Please report the results.  If the script helps, I will code the kernel
>> change to apply the workarounds.
>>
>> #!/bin/sh
>>
>> # Enable workarounds for erratas listed in
>> # https://developer.amd.com/wp-content/resources/55449_1.12.pdf
>>
>> # 1057, 1109
>> sysctl machdep.idle_mwait=0
>> sysctl machdep.idle=hlt
>
>
> Is this needed if it was previously machdep.idle: acpi ?

This might explain why I've never seen the lockup issues mentioned by
other people. What would cause my machine to differ from others?



--
Eitan Adler
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-amd64
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Ryzen public erratas

Gary Jennejohn-6
On Mon, 18 Jun 2018 22:44:13 -0700
Eitan Adler <[hidden email]> wrote:

> On 13 June 2018 at 04:16, Eitan Adler <[hidden email]> wrote:
> > On 13 June 2018 at 03:35, Konstantin Belousov <[hidden email]> wrote:  
> >> Today I noted that AMD published the public errata document for Ryzens,
> >> https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> >>
> >> Some of the issues listed there looks quite relevant to the potential
> >> hangs that some people still experience with the machines.  I wrote
> >> a script which should apply the recommended workarounds to the erratas
> >> that I find interesting.
> >>
> >> To run it, kldload cpuctl, then apply the latest firmware update to your
> >> CPU, then run the following shell script.  Comments indicate the errata
> >> number for the workarounds.
> >>
> >> Please report the results.  If the script helps, I will code the kernel
> >> change to apply the workarounds.
> >>
> >> #!/bin/sh
> >>
> >> # Enable workarounds for erratas listed in
> >> # https://developer.amd.com/wp-content/resources/55449_1.12.pdf
> >>
> >> # 1057, 1109
> >> sysctl machdep.idle_mwait=0
> >> sysctl machdep.idle=hlt  
> >
> >
> > Is this needed if it was previously machdep.idle: acpi ?  
>
> This might explain why I've never seen the lockup issues mentioned by
> other people. What would cause my machine to differ from others?
>

I had sysctl machdep.idle_mwait=1 and machdep.idle=acpi before
applying the shell script.  I had multiple lockups every week,
sometimes multiple lockups per day.

With the idle settings from the script it still locks up, but
not as often.

I suspect I also need to update the CPU firmware, although I
expect that the new BIOS version I installed last week would
have done that already.

--
Gary Jennejohn
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-amd64
To unsubscribe, send any mail to "[hidden email]"