From owner-freebsd-amd64@freebsd.org Tue Jun 26 16:31:28 2018 Return-Path: Delivered-To: freebsd-amd64@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 88BDD10019F4 for ; Tue, 26 Jun 2018 16:31:28 +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 15CCC77FDE for ; Tue, 26 Jun 2018 16:31:28 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id C60B010019F2; Tue, 26 Jun 2018 16:31:27 +0000 (UTC) Delivered-To: amd64@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 A132B10019F0; Tue, 26 Jun 2018 16:31:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (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 208E477FD8; Tue, 26 Jun 2018 16:31:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wr0-x230.google.com with SMTP id a12-v6so17917938wro.1; Tue, 26 Jun 2018 09:31:27 -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=BRJPCMVmatsSPfSumJl9MNz9KEoYEw1FInrURNRinec=; b=LrALL+hw8kVhJcunvyD+6HjmNo+etIYxrcEg0DMRrjSDDxzEJn530b8NbndaxR6wrU 3kCx+F7SKjCbDlVM9CFuOQo/KHKpDFfzW9DAvxfQwjLrcAiqDmZJXTvpvilQs6r1kZGA o9+2D+0Xbeo8koncs09DI0+2XQULf/ATTED/dDvLybg+EJIGawdQVGfFAzahk59zjvsC irLdYsIW7QvoLchpOh1oAihOgWxFXJubrU2jjV1/oA4ZNKMOxJdJwZQXoHB0GSpHW+BQ oBZBOvnj5Mv2gI/8lMlpbHzu+TAOXtcqoHnPjOsPoRSUyxtbAmXaxQ49rBT7DC1/XLj+ 6ZnQ== 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=BRJPCMVmatsSPfSumJl9MNz9KEoYEw1FInrURNRinec=; b=fxI86DhVpfPwGM4j+XJN+WuVD8uYiONERooJNrcq+/Y8yU4rrpaL755fgwuccE64LB J9GCusvF/4Ox9eM9l7/McqNt6zZbpTZ+lSV0XNYfGB536B0IGiKWw++Vhw15LWNCO5Rd ojW64awDQj5WrRSpoikjLrwgYpm3uNRY4nw4VHO4Wbs48qrQ8ZN9wWoEwsjodmlQkp3K ToVnPFL5XHmM7aeM0QsoE8vOsAES6ubd3Yoi8aq9sYRrhiCHfnIUb1SrQF2fwbD+imft oTd28I5bQX0l/8MSA+euWq1XBfbcvLss0310Io7JEgexNLUxsEx7yObvVyeEjWaqUhGK DjzQ== X-Gm-Message-State: APt69E0QGw6HosKNHMIet2E5AZuV1JUgSuZn4oALBNWoUZmLbQtZl7F0 2hu3Ee3skfCfC0ioUSbinyI= X-Google-Smtp-Source: AAOMgpeBCv+VRFpXBUjpdD4DT8Sit4X8hWVb9woUTtsBXH8ruyor/+aB6+3Hd1Rgbky3ncMVu9ihUQ== X-Received: by 2002:a5d:4b4b:: with SMTP id w11-v6mr2113423wrs.87.1530030686149; Tue, 26 Jun 2018 09:31:26 -0700 (PDT) Received: from ernst.home (p5B0234B4.dip0.t-ipconnect.de. [91.2.52.180]) by smtp.gmail.com with ESMTPSA id c6-v6sm2924601wrp.29.2018.06.26.09.31.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 09:31:25 -0700 (PDT) Date: Tue, 26 Jun 2018 18:31:24 +0200 From: Gary Jennejohn To: Eitan Adler Cc: Konstantin Belousov , amd64@freebsd.org, "current@freebsd.org" Subject: Re: Ryzen public erratas Message-ID: <20180626183124.5d2173ec@ernst.home> In-Reply-To: References: <20180613103535.GP2493@kib.kiev.ua> <20180619115030.5491af33@ernst.home> 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-amd64@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2018 16:31:28 -0000 On Tue, 26 Jun 2018 07:05:22 -0700 Eitan Adler wrote: > On 19 June 2018 at 02:50, Gary Jennejohn wrote: > > On Mon, 18 Jun 2018 22:44:13 -0700 > > Eitan Adler wrote: > > > >> On 13 June 2018 at 04:16, Eitan Adler wrote: > >> > On 13 June 2018 at 03:35, Konstantin Belousov 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. > > This makes me curious about why I didn't experience lockups. Perhaps my > BIOS defaulted to something else? > > With these settings: > > machdep.idle: acpi > machdep.idle_mwait: 1 > I can only say that after updating the processor's microcde and applying the errata script my system runs much more stabily. No lockups for days. I suspect that updating the microcode helped quite a bit. I have a first-generation Ryzen 5 1600 with all the errata. -- Gary Jennejohn