From owner-freebsd-current@freebsd.org Wed Jun 13 14:53:00 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 A5A2F1012A2E for ; Wed, 13 Jun 2018 14:53:00 +0000 (UTC) (envelope-from gljennjohn@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 3AE88874CC for ; Wed, 13 Jun 2018 14:53:00 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id E8E971012A2A; Wed, 13 Jun 2018 14:52:59 +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 A8D161012A29; Wed, 13 Jun 2018 14:52:59 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 0BFC8874CA; Wed, 13 Jun 2018 14:52:59 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id o13-v6so5220491wmf.4; Wed, 13 Jun 2018 07:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=dlugMqoBAywqHlORwN7t9qE5Bs/992NHxpymo7ZrP40=; b=cLZ6J3i+cgmLDF/8YudonxgJaewPlsQjot83ursrsO0t6jmSy5oHjtpBSZZcge9D+K PVME1NPza4NAh+sINx4hHlaDq6YPbWHjPil45R6a6BGj39O4EcnfQkerLtqm52iYoeMr FCfnpKaVO7ce0vRgXNblDBFes//pdxmEVuEINYuddg+dPa4LhEiJIgFcCEOUZig5MDF6 i9ExAXmewj2CpCCpbfISUL6JWtPYlJeYtraXgyicyGEUtJ14GmQtyKVBb36ei2tBlt5A 9BfnIEx0k2nvZELGZHg7Wwbt0kHuVEoRCk3b0FCvv9SqmTRRFZuh8bFvesdOuBMtVMRk vABA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=dlugMqoBAywqHlORwN7t9qE5Bs/992NHxpymo7ZrP40=; b=VoA7nm0+t0N8yH2E9JKjPGAXpmeDSohsJM/nGBYbY7pbuJmENrV471Q5ig1J+bJ4Ny NPXQtrldC530tWINR3NhJUOhKeK4oK/bHtZuP/ouRZuzZGgvLm0d4cvY2TOpjvyMwtq6 dY5ZRK9AnTTa0w/1u03yIldmWqnFYxovyjVopd0jlLr3I0akre44nsGhjF6ZpCsdSrSr i1psBB0foGRFKOSNyFKYhT3h803Djxm3vMxUCdtKMv7PoH79+In8i+/D4uFBpV6b0a+N V1NWqJetHx1Ci+fK+20ihqQUx2NM6Ue5V+kyRQ41jyJbvZsZVDicds+EdHgdMh81ajJ/ iqvg== X-Gm-Message-State: APt69E1tX4B2Re8uTRXmxGEpohAwoJIaQ+5pOuMu9c0eFSXDzFjCyHm8 0QTbkrDm9kzVOp0r+y90WFw= X-Google-Smtp-Source: ADUXVKKIYG0TKYjlgvW0uwdJs7dPk9WeiVI4vWTCTMK1c99XW4jJgRTFQw+l12XKWPkb8mLhSsb1sw== X-Received: by 2002:a1c:934e:: with SMTP id v75-v6mr4149088wmd.52.1528901578077; Wed, 13 Jun 2018 07:52:58 -0700 (PDT) Received: from ernst.home (p5B02381D.dip0.t-ipconnect.de. [91.2.56.29]) by smtp.gmail.com with ESMTPSA id w67-v6sm3795476wmw.0.2018.06.13.07.52.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 07:52:57 -0700 (PDT) Date: Wed, 13 Jun 2018 16:52:56 +0200 From: Gary Jennejohn To: Konstantin Belousov Cc: Johannes Lundberg , amd64@freebsd.org, current@freebsd.org Subject: Re: Ryzen public erratas Message-ID: <20180613165256.2b0dac0d@ernst.home> In-Reply-To: <20180613114625.GQ2493@kib.kiev.ua> References: <20180613103535.GP2493@kib.kiev.ua> <86602neyil.fsf@gmail.com> <20180613114625.GQ2493@kib.kiev.ua> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 14:53:00 -0000 On Wed, 13 Jun 2018 14:46:25 +0300 Konstantin Belousov 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