From owner-freebsd-current@freebsd.org Wed Jun 13 11:06:47 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0A51020B77 for ; Wed, 13 Jun 2018 11:06:47 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 85AC37B2B6 for ; Wed, 13 Jun 2018 11:06:46 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 468291020B6C; Wed, 13 Jun 2018 11:06:46 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 223F51020B68; Wed, 13 Jun 2018 11:06:46 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B50E27B2B2; Wed, 13 Jun 2018 11:06:45 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id p126-v6so4000193wmb.2; Wed, 13 Jun 2018 04:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=BiHt1gCzkMg4x5Ql72yid7lgCcynRFaxh9t6uDbClMM=; b=XwF+wPnCEOpUhFFyAzD6DFpZtDEJ61/B2YkHkKP326HxeWy0eD6VPiSFMb1wENBvqQ hbBOuRIs2sk/cH4r6k0XyG1Y453DsQeGR0M6rBadbXbnzNKyncRb7YvHBKSBWTAxjMCi Ftd40ghsDVIXQivMpXsxl77cYyPGmgprPSVSth/HEEqZvJRYMa5ptOrtvCCh+I+OHvrI 94zMYIjHCMrONd9GuJDsHBHK6Sth1Bwf3aY9R5rDmP4e0/Oeqwq+ddRVxJIayFpAxSgb n04AfrZWdRi0SvUoJdJY/6pBvP0LQZiwDCO5uVM8+r3/4ArtyazGnRXTrduM4jMXmko+ RjGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=BiHt1gCzkMg4x5Ql72yid7lgCcynRFaxh9t6uDbClMM=; b=PeNkBW/hluZ0OtiJv4ls3rzU5Juvq5k/6VQ9CKllWKrqeAaRNmUzVo6A+mew9RuIN2 aEMVHB0VBG2n2nu3huxmNXz2toddkN2BJqVm2Uf8lUFpOkjd3zBnVd6ZW38i+IqeFqeU NDpKYEmIDc7KLe+fO8Tsuf9Gdcg5fI80ajPK+a1ZLEbTpRphAHJPXvqTCBJgSp7zuaM9 YUPfF057/7EAlqR7rF7G7E07I87qkQpioFThuFp1HpJ83W9ej2p+VHvJPDnEtU6EtKx7 nfg6IAuTHKBZLX1fGdNbe2kkRCDgAREcB7YKuujCoV4yZM61nVysqOS2sGLORp7KDnzJ qDdg== X-Gm-Message-State: APt69E00jBZgNWbp6vW6eKpRceoYwPeLaZVmduGA9ieY0SSJgq59YlaO ao1v10AHdNdrCDIjq1A2jh/GWg== X-Google-Smtp-Source: ADUXVKI0Sjg9TcJNIdyFifGOgrFvMQUyXv7cwvNIdnFt5q7KAxlqLmk7sZssDI58HHf3Hb8GIAwpfQ== X-Received: by 2002:a1c:4743:: with SMTP id u64-v6mr3102328wma.49.1528888004380; Wed, 13 Jun 2018 04:06:44 -0700 (PDT) Received: from jd.gmail.com ([81.174.250.12]) by smtp.gmail.com with ESMTPSA id y18-v6sm1653544wrl.53.2018.06.13.04.06.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 04:06:43 -0700 (PDT) References: <20180613103535.GP2493@kib.kiev.ua> User-agent: mu4e 1.0; emacs 26.1 From: Johannes Lundberg To: Konstantin Belousov Cc: current@freebsd.org, amd64@freebsd.org Subject: Re: Ryzen public erratas In-reply-to: <20180613103535.GP2493@kib.kiev.ua> Date: Wed, 13 Jun 2018 12:06:42 +0100 Message-ID: <86602neyil.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.26 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: Wed, 13 Jun 2018 11:06:47 -0000 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? > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"